:root {
  --app-bg: #eaf0f7;
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .82);
  --line: rgba(130, 151, 174, .32);
  --text: #17212b;
  --muted: #667789;
  --primary: #1473ff;
  --danger: #c23b3b;
  --shadow: 0 24px 70px rgba(52, 70, 92, .20);
  --blur: blur(28px) saturate(1.35);
  --ui-size: 13px;
  --ui-title-size: 15px;
  font-family: "MiSans", Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(111, 180, 255, .38), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(255, 181, 221, .33), transparent 32%),
    linear-gradient(135deg, #eaf0f7 0%, #f8fbff 47%, #eef4fb 100%);
}

button, input, textarea, select { font: inherit; }
body, button, input, textarea { font-size: var(--ui-size); }
button { cursor: pointer; }

.app {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, .52);
  border-bottom: 1px solid rgba(255, 255, 255, .62);
  box-shadow: 0 8px 28px rgba(54, 75, 98, .10);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.brand {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 26px;
  width: auto;
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0;
}

.autosave {
  font-size: 13px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 18px;
  background: rgba(255, 255, 255, .34);
}

.toolbar-field {
  min-width: 132px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .48);
  border: 1px solid rgba(116, 139, 163, .18);
}

.toolbar-field .input {
  height: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-left: 0;
}

.export-width-field {
  min-width: 252px;
  grid-template-columns: auto 72px auto;
}

.width-presets {
  display: flex;
  gap: 4px;
  padding-right: 6px;
}

.preset-btn {
  height: 28px;
  border: 0;
  border-radius: 10px;
  padding: 0 8px;
  background: rgba(20, 115, 255, .10);
  color: #0c63d4;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.main {
  display: grid;
  grid-template-columns: minmax(200px, 420px) 1fr minmax(200px, 420px);
  min-height: 0;
  overflow: hidden;
}

.editor {
  min-width: 0;
  max-width: 420px;
  height: 100%;
  overflow: auto;
  padding: 18px;
  border-right: 1px solid rgba(255, 255, 255, .62);
  overscroll-behavior: contain;
}

.right-tools {
  min-width: 0;
  width: 100%;
  max-width: 420px;
  height: 100%;
  overflow: auto;
  padding: 18px;
  border-left: 1px solid rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .18);
  overscroll-behavior: contain;
  justify-self: end;
}

.preview-wrap {
  min-width: 780px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overscroll-behavior: contain;
}

.panel,
.module-card,
.crop-box {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: 0 12px 36px rgba(62, 80, 103, .12);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.panel {
  border-radius: 20px;
  margin-bottom: 14px;
  overflow: hidden;
}

.panel.basic-panel {
  border-color: rgba(20, 115, 255, .22);
}

.panel.modules-panel {
  border-color: rgba(112, 92, 255, .24);
}

.panel.basic-panel .panel-head {
  background: linear-gradient(90deg, rgba(20, 115, 255, .10), rgba(255, 255, 255, .22));
}

.panel.modules-panel .panel-head {
  background: linear-gradient(90deg, rgba(112, 92, 255, .11), rgba(255, 255, 255, .22));
}

.panel-head,
.module-head {
  min-height: 48px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.panel-title,
.module-title {
  font-size: var(--ui-title-size);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.panel-body,
.module-body {
  padding: 14px;
  display: grid;
  gap: 13px;
}

.module-card {
  border-radius: 18px;
  overflow: visible; /* 允许更多菜单的下拉超出卡片边界 */
}

/* 父模块头部：渐变背景需要圆角裁剪（overflow:visible 时靠自身 border-radius 裁剪） */
.module-group > .module-card > .module-head {
  border-radius: 18px 18px 0 0;
}

.module-head .icon-actions {
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  flex-shrink: 0;
}
/* 悬浮或聚焦时显示更多按钮；下拉打开时始终保持可见 */
.module-card:hover > .module-head .icon-actions,
.module-card:focus-within > .module-head .icon-actions,
.module-card:has(.more-menu.open) > .module-head .icon-actions {
  opacity: 1;
  pointer-events: auto;
}
/* 下拉打开时让整张卡片提升层级，确保下拉浮在后续兄弟卡片之上 */
.module-card:has(.more-menu.open) {
  position: relative;
  z-index: 10;
}

.module-card.active {
  border-color: rgba(20, 115, 255, .38);
  box-shadow: 0 16px 42px rgba(20, 115, 255, .14);
}

.module-summary {
  padding: 11px 14px 14px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.summary-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-card.dragging {
  opacity: .55;
  outline: 2px solid var(--primary);
}

.form-row {
  display: grid;
  gap: 7px;
}

.form-row label,
.field-inline,
.check-row {
  color: #405060;
  font-size: var(--ui-size);
  font-weight: 650;
}

.field-inline,
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid rgba(116, 139, 163, .34);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  color: var(--text);
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}

select.select {
  display: none;
}

.select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #60758b 50%),
    linear-gradient(135deg, #60758b 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 17px,
    calc(100% - 12px) 17px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-select-button {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(116, 139, 163, .34);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.custom-select-button::after {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2360778b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .16s;
}

.custom-select.open .custom-select-button::after {
  transform: rotate(180deg);
}

.custom-select.open .custom-select-button {
  border-color: rgba(20, 115, 255, .58);
  box-shadow: 0 0 0 4px rgba(20, 115, 255, .12);
}

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  display: none;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 20px 50px rgba(48, 64, 84, .18);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.custom-select.open .custom-select-menu {
  display: grid;
  gap: 4px;
}

.custom-select-option {
  min-height: 34px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 10px;
}

.custom-select-option:hover,
.custom-select-option.active {
  background: rgba(20, 115, 255, .12);
  color: #0c63d4;
}

.input,
.select {
  height: 40px;
  padding: 0 12px;
}

.textarea {
  min-height: 104px;
  resize: vertical;
  padding: 10px 12px;
  line-height: 1.65;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(20, 115, 255, .78);
  box-shadow: 0 0 0 4px rgba(20, 115, 255, .13);
  background: rgba(255, 255, 255, .9);
}

.button,
.small-btn,
.format-btn {
  border: 1px solid rgba(116, 139, 163, .32);
  background: rgba(255, 255, 255, .68);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.button {
  height: 40px;
  border-radius: 14px;
  padding: 0 14px;
  gap: 8px;
}

.button:hover,
.small-btn:hover,
.format-btn:hover {
  background: rgba(255, 255, 255, .88);
  border-color: rgba(96, 119, 143, .46);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #0a84ff, #6a7cff);
  color: #fff;
  box-shadow: 0 14px 28px rgba(20, 115, 255, .28);
}

.button:disabled {
  opacity: .38;
  cursor: not-allowed;
  box-shadow: none;
}

/* 图片裁剪弹窗：显示完整原图 + 裁剪框（框外变暗但可见） */
.crop-stage {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 320px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background:
    repeating-conic-gradient(#e9eef4 0% 25%, #f7fafc 0% 50%) 50% / 22px 22px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.crop-stage:active { cursor: grabbing; }
.crop-image {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: left, top, width, height;
}
.crop-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 2px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .48);
  pointer-events: none;
  /* 九宫格参考线 */
  background-image:
    linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  background-position: center;
  background-blend-mode: overlay;
}

.button.icon-only {
  padding: 0 11px;
}

.button.danger,
.small-btn.danger {
  color: var(--danger);
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-card {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(116, 139, 163, .26);
  border-radius: 16px;
  background: rgba(255, 255, 255, .54);
}

.upload-card .button {
  flex: 0 0 auto;
}

/* 封面图缩略图（左侧面板，可点击打开编辑弹窗） */
.cover-thumb-wrap {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(116, 139, 163, .26);
  background: #000;
  aspect-ratio: 16 / 9;
}

.cover-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .2s;
}

.cover-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  transition: opacity .2s;
  letter-spacing: .04em;
}

.cover-thumb-wrap:hover .cover-thumb-img {
  opacity: .75;
}

.cover-thumb-wrap:hover .cover-thumb-overlay {
  opacity: 1;
}

.upload-btn {
  height: 32px;
  border-radius: 12px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0c63d4;
  background: rgba(20, 115, 255, .12);
  border: 1px solid rgba(20, 115, 255, .24);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  cursor: pointer;
}

.upload-status {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.small-btn {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  font-size: 13px;
  line-height: 1;
}

.small-btn svg,
.button svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 三点更多按钮：填充圆点，无描边 */
.more-btn svg {
  fill: currentColor;
  stroke: none;
}

/* ── 更多下拉菜单 ── */
.more-menu {
  position: relative;
  flex-shrink: 0;
}
.more-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  bottom: auto;
  z-index: 200;
  min-width: 128px;
  display: none;
  flex-direction: column;
  gap: 1px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(116, 139, 163, .16);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(48, 64, 84, .16);
  padding: 4px;
  backdrop-filter: blur(8px);
}
.more-menu.open .more-dropdown { display: flex; }
/* 向上弹出（空间不足时由 JS 动态添加 drop-up 类） */
.more-menu.drop-up .more-dropdown {
  top: auto;
  bottom: calc(100% + 4px);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.dropdown-item svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.dropdown-item:hover { background: rgba(20, 115, 255, .07); color: var(--primary); }
.dropdown-item.danger { color: #dc2626; }
.dropdown-item.danger:hover { background: rgba(220, 38, 38, .07); color: #dc2626; }
.dropdown-divider {
  border: 0;
  border-top: 1px solid rgba(116, 139, 163, .12);
  margin: 3px 6px;
}

.format-btn {
  height: 34px;
  min-width: 38px;
  border-radius: 12px;
  padding: 0 10px;
  font-weight: 760;
}

.format-btn.active {
  background: rgba(20, 115, 255, .16);
  border-color: rgba(20, 115, 255, .45);
  color: #0b62d8;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.three-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.format-grid {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
}

.icon-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-name,
.hint {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.file-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.color-card {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(116, 139, 163, .34);
  border-radius: 14px;
  padding: 5px 10px 5px 5px;
  background: rgba(255, 255, 255, .72);
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .84);
  box-shadow: 0 6px 14px rgba(45, 58, 74, .16);
  background: var(--swatch, #1473ff);
  flex: 0 0 auto;
}

.color-value {
  color: #405060;
  font-size: 12px;
  font-weight: 760;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.range-row input { width: 100%; }

input[type="range"] {
  appearance: none;
  height: 24px;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(20, 115, 255, .75), rgba(137, 196, 255, .48));
  box-shadow: inset 0 1px 2px rgba(47, 67, 90, .16);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(20, 115, 255, .38);
  box-shadow: 0 8px 20px rgba(20, 115, 255, .24);
}

input[type="checkbox"] {
  appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(116, 139, 163, .32);
  background: rgba(255, 255, 255, .62);
  position: relative;
  flex: 0 0 auto;
  transition: background .16s, border-color .16s;
}

input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(44, 61, 80, .20);
  transition: transform .16s;
}

input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #0a84ff, #6a7cff);
  border-color: transparent;
}

input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

.crop-box {
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.poster-shell {
  width: var(--poster-width, 750px);
  flex: 0 0 auto;
  background: #fff;
  box-shadow: var(--shadow);
}

.poster {
  width: 100%;
  min-height: 860px;
  background: var(--poster-bg);
  color: var(--poster-text);
  overflow: hidden;
  font-family: var(--poster-font);
  font-style: var(--poster-font-style);
}

.poster [contenteditable="true"] {
  outline: 2px solid transparent;
  outline-offset: 4px;
  border-radius: 6px;
  cursor: text;
}

.poster [contenteditable="true"]:focus {
  outline-color: rgba(20, 115, 255, .45);
  background: rgba(20, 115, 255, .06);
}

.poster-inner { padding: 76px 46px 82px; }

.poster-hero {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--poster-soft-line);
}

.poster-title {
  margin: 0;
  color: var(--poster-title);
  font-size: var(--title-size);
  font-weight: var(--title-weight);
  font-style: var(--title-style);
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-align: justify;
}

.poster-subtitle {
  margin: 18px 0 0;
  color: var(--poster-muted);
  font-size: var(--subtitle-size);
  font-weight: var(--subtitle-weight);
  font-style: var(--subtitle-style);
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-align: justify;
}

.brand-image,
.qr-image {
  width: 100%;
  display: block;
  object-fit: var(--image-fit);
  border-radius: var(--image-radius);
}

/* 封面：容器负责裁剪，内部 .cover-img 负责缩放/平移 */
.poster-cover {
  width: 100%;
  display: block;
  margin-top: 30px;
  aspect-ratio: var(--cover-aspect);
  border-radius: var(--image-radius);
  position: relative;
  overflow: hidden;
}
.poster-cover > .cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: var(--cover-fit);
  transform: translate(var(--cover-tx, 0px), var(--cover-ty, 0px)) scale(var(--cover-scale, 1));
  transform-origin: center;
  cursor: grab;
  touch-action: none;
}
.poster-cover > .cover-img:active { cursor: grabbing; }

/* 封面图悬停提示 */
.poster-cover::after {
  content: "点击编辑";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  background: rgba(0, 0, 0, .36);
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
  z-index: 2;
}
.poster-cover:hover::after {
  opacity: 1;
}

.poster-section {
  padding: var(--section-gap) 0 0;
  transition: opacity .14s, transform .14s;
}

.poster-section[draggable="true"] {
  cursor: grab;
}

.poster-section.drag-over {
  transform: translateY(8px);
  opacity: .68;
}

.section-title-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-number {
  min-width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--poster-primary);
  color: #fff;
  display: var(--number-display);
  align-items: center;
  justify-content: center;
  font-weight: 850;
  font-size: 18px;
  flex: 0 0 auto;
}

.section-title {
  margin: 3px 0 0;
  color: var(--poster-title);
  font-size: var(--section-title-size, calc(var(--body-size) + 10px));
  font-weight: var(--section-title-weight);
  font-style: var(--section-title-style);
  line-height: 1.28;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-align: justify;
}

.hero-body {
  margin: 14px 0 0;
  color: var(--poster-muted);
  font-size: var(--body-size);
  font-weight: var(--body-weight);
  font-style: var(--body-style);
  text-indent: var(--body-indent, 0);
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: justify;
}

.section-body {
  color: var(--poster-muted);
  font-size: var(--body-size);
  font-weight: var(--body-weight);
  font-style: var(--body-style);
  text-indent: var(--body-indent, 0);
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: justify;
}

.image-grid {
  margin-top: 20px;
  display: grid;
  gap: 16px;
  width: 100%;
  min-width: 0;
  justify-items: center;
  align-items: center;
}

.image-grid.single { grid-template-columns: 1fr; }
.image-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }
.image-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.image-grid.feature-left { grid-template-columns: 1.35fr 1fr; }
.image-grid.feature-right { grid-template-columns: 1fr 1.35fr; }
.image-grid.masonry { grid-template-columns: repeat(2, 1fr); align-items: start; }

.image-grid.feature-left .image-figure:first-child,
.image-grid.feature-right .image-figure:last-child {
  grid-row: span 2;
}

.image-grid.free {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.image-grid.free .image-figure {
  flex: 1 1 calc(50% - 16px);
  min-width: 180px;
  max-width: 100%;
}

.image-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--image-radius);
  background: rgba(255, 255, 255, .46);
  width: 100%;
  margin: 0;
  min-width: 0;
}

.image-figure {
  width: 100%;
  margin: 0;
  min-width: 0;
}

.image-frame.show-tools {
  outline: 2px solid rgba(20, 115, 255, .46);
  outline-offset: 3px;
}

.image-frame::before {
  content: "";
  display: block;
  aspect-ratio: var(--image-aspect, 4 / 3);
}

.image-grid.masonry .image-figure:nth-child(2n) .image-frame::before { aspect-ratio: 4 / 5; }
.image-grid.masonry .image-figure:nth-child(3n) .image-frame::before { aspect-ratio: 1 / 1; }

.section-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: var(--image-fit, cover);
  transform: translate(var(--img-tx, 0px), var(--img-ty, 0px)) scale(var(--img-scale, 1));
  transform-origin: center;
  cursor: grab;
  touch-action: none;
}
.section-image:active { cursor: grabbing; }

.image-tools {
  position: absolute;
  inset: 10px 10px auto auto;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s;
}

.image-frame:hover .image-tools,
.image-frame.show-tools .image-tools {
  opacity: 1;
  pointer-events: auto;
}

/* 内容图片悬停提示 */
.image-frame::after {
  content: "点击编辑";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  background: rgba(0, 0, 0, .36);
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
  z-index: 1;
}
.image-frame:hover::after {
  opacity: 1;
}

.image-tool {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .84);
  color: #17212b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(44, 61, 80, .18);
  cursor: pointer;
}

.image-tool.danger {
  color: var(--danger);
}

.image-tool svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.per-image-caption {
  margin-top: 8px;
  color: var(--poster-muted);
  font-size: calc(var(--body-size) - 4px);
  line-height: 1.45;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.image-item-list {
  display: grid;
  gap: 8px;
}

.image-item-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(116, 139, 163, .22);
  border-radius: 14px;
  background: rgba(255, 255, 255, .46);
}

/* 内容块编辑器 */
.blocks-list { display: grid; gap: 10px; }
.blk {
  border: 1px solid rgba(116, 139, 163, .24);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, .42);
  display: grid;
  gap: 8px;
}
.blk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.blk-tag {
  font-size: 12px;
  font-weight: 760;
  color: var(--muted);
  background: rgba(20, 115, 255, .10);
  border-radius: 8px;
  padding: 2px 10px;
}
.blk-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.blk:hover .blk-actions,
.blk:focus-within .blk-actions {
  opacity: 1;
  pointer-events: auto;
}
.block-add-row { display: flex; gap: 8px; margin-top: 4px; }
.add-block-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 12px;
  border: 1.5px dashed rgba(20, 115, 255, .4);
  background: rgba(20, 115, 255, .06);
  color: #0c63d4;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.add-block-btn:hover { background: rgba(20, 115, 255, .12); }

.image-item-name {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-caption {
  margin-top: 9px;
  color: var(--poster-muted);
  font-size: calc(var(--body-size) - 3px);
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* ── 自由组合块间距
   旧版正文/图片是固定顺序，间距写死在各自 margin-top 上。
   新版可任意组合，需为每种相邻关系单独声明：
   - 图片/说明 → 正文：补充上间距（原来是 0）
   - 连续正文块：相互之间加间距
   同特异度的模板覆盖规则（如 .poster.ec-dark .section-body）因
   在文件靠后位置声明，会正常覆盖这里的基础值。 */
.image-grid   + .section-body,
.image-caption + .section-body  { margin-top: 14px; }
.section-body + .section-body   { margin-top: 14px; }
.image-grid   + .subsection-body,
.image-caption + .subsection-body { margin-top: 12px; }
.subsection-body + .subsection-body { margin-top: 12px; }

.poster-footer {
  margin-top: 42px;
  padding-top: 24px;
  border-top: 1px solid var(--poster-soft-line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: end;
}

.footer-text {
  color: var(--poster-muted);
  font-size: var(--body-size);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.footer-assets {
  display: flex;
  align-items: end;
  gap: 14px;
}

.brand-image {
  width: 110px;
  max-height: 70px;
  object-fit: contain;
  border-radius: 0;
}

.qr-image {
  width: 104px;
  height: 104px;
  object-fit: cover;
}

.empty-image {
  min-height: 168px;
  border: 1px dashed var(--poster-soft-line);
  border-radius: var(--image-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--poster-muted);
  font-size: 17px;
  background: rgba(255, 255, 255, .42);
}

.poster.public-account {
  --poster-title: #17202a;
  --poster-text: #28323c;
  --poster-muted: #687581;
  --poster-soft-line: rgba(35, 52, 68, .14);
}

.poster.corporate {
  --poster-title: #102439;
  --poster-text: #23374a;
  --poster-muted: #627286;
  --poster-soft-line: rgba(16, 36, 57, .18);
}

.poster.corporate .poster-hero {
  border-bottom-width: 3px;
  border-color: var(--poster-primary);
}

.poster.corporate .section-number { border-radius: 50%; }

.poster.ecommerce {
  --poster-title: #211917;
  --poster-text: #342724;
  --poster-muted: #795f57;
  --poster-soft-line: rgba(52, 39, 36, .15);
}

.poster.ecommerce .poster-inner {
  padding: 76px 42px 82px;
}

.poster.ecommerce .poster-section {
  margin-top: var(--section-gap);
  padding: 28px;
  background: rgba(255, 255, 255, .76);
  border: 1px solid var(--poster-soft-line);
  border-radius: 18px;
}

/* V2：自定义卡片化 — 由 styles.cardStyle === "filled" 触发 */
.poster.has-cards .poster-section {
  margin-top: var(--section-gap);
  padding: var(--card-padding);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
}
.poster.ecommerce.has-cards .poster-section {
  background: var(--card-bg);
  border-color: var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
}

/* ── 科技蓝模板 (pa-originos) ── */
.poster.originos {
  --poster-title: #1A1A2E;
  --poster-text: #2E3440;
  --poster-muted: #667788;
  --poster-soft-line: var(--pp12);
}
.poster.originos .poster-inner {
  padding: 76px 46px 82px;
  background:
    radial-gradient(ellipse at 70% 0%, var(--pp15) 0%, transparent 45%),
    radial-gradient(ellipse at 10% 100%, var(--pp10) 0%, transparent 40%),
    var(--poster-bg);
}
/* 章节卡片 */
.poster.originos .poster-section {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 4px 28px rgba(0,0,0,.065);
  padding: 0;
  margin-top: var(--section-gap);
}
/* 标题栏：主题色渐变 */
.poster.originos .section-title-row {
  background: linear-gradient(90deg, var(--pp12), var(--pp07));
  border-bottom: 1.5px solid var(--pp14);
  padding: 14px 22px;
  margin-bottom: 0;
  justify-content: space-between;
  align-items: center;
}
/* PART.X 右侧，主题色文字 */
.poster.originos .section-number {
  order: 2;
  background: var(--poster-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  border-radius: 0;
  width: auto; height: auto; min-width: 0;
  padding: 0;
}
.poster.originos .section-number::before { content: "PART."; }
/* 章节标题 */
.poster.originos .section-title {
  order: 1;
  margin: 0;
  color: #1A1A2E;
}
/* 正文与图片 */
.poster.originos .section-body {
  padding: 20px 24px 20px;
}
.poster.originos .image-grid {
  margin: 0 20px 20px;
  width: auto;
}
/* 图片直接跟在标题栏后，无正文时补充顶部间距 */
.poster.originos .section-title-row + .image-grid { margin-top: 20px; }
.poster.originos .image-caption {
  padding: 0 24px;
  margin-bottom: 16px;
}
/* 子模块 */
.poster.originos .poster-subsections {
  border-left: none;
  margin: 4px 22px 20px;
  padding-left: 0;
  gap: 10px;
}
.poster.originos .poster-subsection {
  background: var(--pp04);
  border-radius: 10px;
  padding: 12px 14px;
}
.poster.originos .subsection-title-row {
  margin-bottom: 8px;
  align-items: center;
}
.poster.originos .subsection-title { margin: 0; }
.poster.originos .subsection-number {
  background: var(--poster-primary);
  color: #fff;
  font-size: 12px; font-weight: 700;
  width: auto; height: auto; min-width: 0;
  border: none;
  border-radius: 8px 8px 8px 0;
  padding: 3px 10px;
}
/* Footer */
.poster.originos .poster-footer {
  border-top: 1px solid var(--pp12);
  margin-top: 30px;
  padding-top: 20px;
}

/* ── 清新蓝模板 (pa-weixin) ── */
.poster.weixin-blue {
  --poster-title: #1A2A3A;
  --poster-text: #3D5060;
  --poster-muted: #7A8EA0;
  --poster-soft-line: var(--pp18);
}
.poster.weixin-blue .poster-inner {
  padding: 52px 22px 36px;
  background:
    radial-gradient(ellipse at 80% 10%, rgba(255,255,255,.48) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 90%, rgba(140,210,255,.35) 0%, transparent 50%),
    linear-gradient(170deg, #C2E4F7 0%, #D0EAF9 50%, #C0E1F5 100%);
}
.wb-header {
  text-align: center;
  margin-bottom: 28px;
}
.wb-app-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #5BBCFF, #2B88EE);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 6px 18px rgba(43,136,238,.30);
}
.wb-main-title {
  font-size: 36px;
  font-weight: 900;
  color: #1A2A3A;
  line-height: 1.2;
  margin: 0;
}
.wb-main-sub {
  font-size: 36px;
  font-weight: 900;
  color: #1A2A3A;
  line-height: 1.25;
  margin: 0 0 10px;
}
.wb-header-desc {
  font-size: 14px;
  color: #7A8EA0;
  margin: 0;
  line-height: 1.6;
}
.wb-section {
  background: rgba(255,255,255,.52);
  border-radius: 18px;
  padding: 18px 16px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(74,171,247,.10);
}
.wb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.wb-section-name {
  font-size: 17px;
  font-weight: 800;
  color: #1A2A3A;
  display: flex;
  align-items: center;
  gap: 7px;
}
.wb-section-name::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5BBCFF, #2B88EE);
  flex-shrink: 0;
}
.wb-part-label {
  font-size: 13px;
  font-weight: 700;
  color: #4AABF7;
  letter-spacing: .06em;
}
.wb-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.wb-card:last-child { margin-bottom: 0; }
.wb-card-tag {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(90deg, #5BBCFF, #2E90F0);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 14px 0 14px 0;
  margin: 0;
}
.wb-card-body {
  padding: 10px 14px 12px;
  font-size: 13px;
  color: #3D5060;
  line-height: 1.75;
}
.wb-img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 10px 10px;
}
.wb-img-slot {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #D4EEFF, #BDD8F0);
  border-radius: 8px;
  overflow: hidden;
}
.wb-img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wb-footer-note {
  text-align: center;
  font-size: 11px;
  color: #A0B4C4;
  margin-top: 10px;
  line-height: 1.6;
}

/* ── 清新蓝：标准元素样式覆盖 ── */
.poster.weixin-blue .poster-inner {
  padding: 76px 46px 82px;
  background:
    radial-gradient(ellipse at 80% 8%, rgba(255,255,255,.52) 0%, transparent 48%),
    radial-gradient(ellipse at 12% 92%, var(--pp35) 0%, transparent 42%),
    var(--poster-bg);
}

/* Hero：居中，无背景 */
.poster.weixin-blue .poster-hero {
  text-align: center;
  border-bottom: none;
  padding-bottom: 30px;
}
.poster.weixin-blue .poster-title {
  text-align: center;
}
.poster.weixin-blue .poster-subtitle {
  text-align: center;
}
.poster.weixin-blue .hero-body {
  text-align: justify;
}
.poster.weixin-blue .poster-cover {
  border-radius: var(--image-radius);
  overflow: hidden;
  margin-top: 20px;
}

/* 每个 section → 白色卡片，用 margin-top 保留 section-gap 间距 */
.poster.weixin-blue .poster-section {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(0,0,0,.07);
  padding: 0;
  margin-top: var(--section-gap);
}

/* section-title-row → 主题色背景标题栏 */
.poster.weixin-blue .section-title-row {
  background: var(--poster-primary);
  border-bottom: none;
  padding: 14px 22px;
  margin-bottom: 0;
  justify-content: space-between;
  align-items: center;
}

/* section-number → 右侧 PART.X，白色文字 */
.poster.weixin-blue .section-number {
  order: 2;
  background: transparent;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  border-radius: 0;
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
}
.poster.weixin-blue .section-number::before {
  content: "PART.";
}

/* section-title → 左侧标题，白色文字 */
.poster.weixin-blue .section-title {
  order: 1;
  margin: 0;
  color: #fff;
}

/* 正文和图片内边距 */
.poster.weixin-blue .section-body {
  padding: 20px 24px 20px;
}
.poster.weixin-blue .image-grid {
  margin: 16px 20px 20px;
  width: auto;
}
.poster.weixin-blue .image-caption {
  padding: 0 24px;
  margin-bottom: 16px;
}

/* 子模块（有 children 时）→ 蓝标签风格 */
.poster.weixin-blue .poster-subsections {
  border-left: none;
  padding-left: 0;
  margin: 10px 14px 14px;
  gap: 10px;
}
.poster.weixin-blue .poster-subsection {
  background: var(--pp07);
  border-radius: 12px;
  padding: 12px 14px;
}
.poster.weixin-blue .subsection-title-row {
  margin-bottom: 8px;
  align-items: center;
}
.poster.weixin-blue .subsection-title {
  margin: 0;
}
.poster.weixin-blue .subsection-number {
  background: var(--poster-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  width: auto;
  height: auto;
  min-width: 0;
  border: none;
  border-radius: 8px 8px 8px 0;
  padding: 3px 12px;
}

/* Footer */
.poster.weixin-blue .poster-footer {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  border-top: 1px solid var(--pp18);
  margin-top: 30px;
  padding-top: 20px;
}
.poster.weixin-blue .footer-text {
  text-align: center;
  font-size: 11px;
  color: #A0B4C4;
}

/* ── 暗黑橙模板 (pa-openclaw) ── */
.poster.openclaw-dark {
  --poster-title: #F8FAFC;
  --poster-text: #E2E8F0;
  --poster-muted: #94A3B8;
  --poster-soft-line: rgba(255,255,255,.07);
}
.poster.openclaw-dark .poster-inner {
  padding: 76px 46px 82px;
  background:
    radial-gradient(ellipse at 20% 0%, var(--pp12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, var(--pp08) 0%, transparent 45%),
    var(--poster-bg);
}
/* Hero */
.poster.openclaw-dark .poster-hero {
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding-bottom: 36px;
}
.poster.openclaw-dark .poster-title {
  text-align: center;
  color: #F1F5F9;
}
.poster.openclaw-dark .poster-subtitle {
  text-align: center;
  color: #94A3B8;
}
.poster.openclaw-dark .hero-body {
  text-align: justify;
  color: #CBD5E1;
}
.poster.openclaw-dark .poster-cover {
  border-radius: var(--image-radius);
  overflow: hidden;
  margin-top: 20px;
}
/* Section 卡片 */
.poster.openclaw-dark .poster-section {
  background: #16161E;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,.45), 0 0 0 0.5px var(--pp08);
  padding: 0;
  margin-top: var(--section-gap);
}
/* 标题栏：主题色 */
.poster.openclaw-dark .section-title-row {
  background: var(--poster-primary);
  border-bottom: none;
  padding: 14px 22px;
  margin-bottom: 0;
  justify-content: space-between;
  align-items: center;
}
/* PART.X 右侧，白色半透 */
.poster.openclaw-dark .section-number {
  order: 2;
  background: transparent;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  border-radius: 0;
  width: auto; height: auto; min-width: 0;
  padding: 0;
}
.poster.openclaw-dark .section-number::before { content: "PART."; }
/* 章节标题白色 */
.poster.openclaw-dark .section-title {
  order: 1;
  margin: 0;
  color: #FFFFFF;
}
/* 正文 */
.poster.openclaw-dark .section-body {
  padding: 20px 24px 20px;
  color: #E2E8F0;
}
/* 图片网格 */
.poster.openclaw-dark .image-grid {
  margin: 0 20px 20px;
  width: auto;
}
/* 图片直接跟在标题栏后，无正文时补充顶部间距 */
.poster.openclaw-dark .section-title-row + .image-grid { margin-top: 20px; }
.poster.openclaw-dark .image-caption {
  padding: 0 24px;
  margin-bottom: 16px;
  color: #64748B;
}
/* 子模块 */
.poster.openclaw-dark .poster-subsections {
  border-left: none;
  margin: 4px 22px 20px;
  padding-left: 0;
  gap: 10px;
}
.poster.openclaw-dark .poster-subsection {
  background: var(--pp06);
  border-radius: 8px;
  padding: 12px 14px;
}
.poster.openclaw-dark .subsection-title-row {
  margin-bottom: 8px;
  align-items: center;
}
.poster.openclaw-dark .subsection-title {
  margin: 0;
  color: #F1F5F9;
}
.poster.openclaw-dark .subsection-number {
  background: var(--poster-primary);
  color: #fff;
  font-size: 12px; font-weight: 700;
  width: auto; height: auto; min-width: 0;
  border: none;
  border-radius: 6px 6px 6px 0;
  padding: 3px 10px;
}
.poster.openclaw-dark .subsection-body { color: #CBD5E1; }
/* Footer */
.poster.openclaw-dark .poster-footer {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 32px;
  padding-top: 22px;
}
.poster.openclaw-dark .footer-text {
  text-align: center;
  font-size: 11px;
  color: #475569;
}

/* ── 深色产品长图 (ec-dark) ── */
.poster.ec-dark {
  --poster-title: #ffffff;
  --poster-text: #e2e8f0;
  --poster-muted: #94a3b8;
  --poster-soft-line: var(--pp12);
}
.poster.ec-dark .poster-inner {
  padding: 0;
  background: var(--poster-bg);
}
/* Hero */
.poster.ec-dark .poster-hero {
  padding: 64px 48px 56px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  background: transparent;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* 调整 hero 区域子元素顺序：标题 → 副标题 → 封面图 → 正文 */
.poster.ec-dark .poster-title   { order: 1; }
.poster.ec-dark .poster-subtitle { order: 2; }
.poster.ec-dark .poster-cover   { order: 3; }
.poster.ec-dark .hero-body      { order: 4; }
.poster.ec-dark .poster-hero::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%; transform: translateX(-50%);
  width: 480px; height: 280px;
  background: radial-gradient(ellipse, var(--pp14) 0%, transparent 70%);
  pointer-events: none;
}
.poster.ec-dark .poster-title {
  text-align: center;
  background: linear-gradient(135deg, #ffffff 30%, var(--poster-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}
.poster.ec-dark .poster-subtitle {
  text-align: center;
  font-weight: var(--subtitle-weight);
  font-style: var(--subtitle-style);
  color: #ffffff;
  margin-top: 6px;
  letter-spacing: 2px;
}
.poster.ec-dark .hero-body {
  text-align: center;
  color: #b8c4d2;
  line-height: 1.9;
  margin: 20px 0 0;
}
.poster.ec-dark .poster-cover {
  border-radius: var(--image-radius);
  border: 1px solid var(--pp18);
  margin-top: 36px;
}
/* Sections */
.poster.ec-dark .poster-section {
  padding: 52px 48px;
  background: transparent;
  border: none;
  border-radius: 0;
  border-top: 1px solid rgba(255, 255, 255, .04);
  margin-top: var(--section-gap);
}
.poster.ec-dark .poster-section:nth-child(even) {
  background: #0c1220;
}
.poster.ec-dark .section-title-row {
  display: block;
  margin-bottom: 0;
}
.poster.ec-dark .section-number {
  display: var(--number-display);
  background: var(--pp12);
  color: var(--poster-primary-solid);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  min-width: 28px;
  height: 28px;
  margin-bottom: 12px;
}
.poster.ec-dark .section-title {
  font-weight: var(--section-title-weight);
  font-style: var(--section-title-style);
  width: fit-content;
  padding-right: 0.2em; /* 给斜体字形留出右侧溢出空间，防止 background-clip 裁切 */
  color: transparent;
  background: linear-gradient(90deg, #ffffff 0%, var(--poster-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1.35;
}
.poster.ec-dark .section-body {
  color: #b8c4d2;
  font-size: var(--body-size);
  line-height: 1.9;
  margin-top: 8px;
}
.poster.ec-dark .image-grid {
  margin-top: 28px;
}
.poster.ec-dark .image-frame {
  border-radius: var(--image-radius);
  background: rgba(14, 26, 46, .9);
  border: 1px solid var(--pp12);
}
.poster.ec-dark .image-caption {
  color: #64748b;
  font-size: 13px;
  text-align: center;
}
/* Subsections */
.poster.ec-dark .poster-subsections {
  border-left: none;
  padding-left: 0;
  margin-top: 22px;
}
.poster.ec-dark .poster-subsection {
  padding-top: 14px;
}
.poster.ec-dark .subsection-title-row { margin-bottom: 8px; }
.poster.ec-dark .subsection-number {
  background: var(--pp15);
  color: var(--poster-primary-solid);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  width: auto; height: auto; min-width: 0;
  padding: 2px 9px;
}
.poster.ec-dark .subsection-title { color: #e2e8f0; margin: 0; }
.poster.ec-dark .subsection-body { color: #b8c4d2; }
/* Footer */
.poster.ec-dark .poster-footer {
  padding: 32px 48px 40px;
  border-top: 1px solid rgba(255, 255, 255, .05);
  background: #040810;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  margin-top: 0;
}
.poster.ec-dark .footer-text {
  color: #475569;
  font-size: 12px;
  text-align: center;
}
.poster.ec-dark .brand-image,
.poster.ec-dark .qr-image {
  filter: brightness(0.7);
}

/* ── 深蓝产品长图 (ec-blue) ── */
.poster.ec-blue {
  --poster-title: var(--poster-primary);
  --poster-text: #e2e8f0;
  --poster-muted: #b8c4d2;
  --poster-soft-line: var(--pp10);
}
.poster.ec-blue .poster-inner {
  padding: 0;
  background: var(--poster-bg);
}
/* Hero */
.poster.ec-blue .poster-hero {
  padding: 64px 48px 56px;
  text-align: center;
  border-bottom: 1px solid var(--pp10);
  background: transparent;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.poster.ec-blue .poster-hero::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%; transform: translateX(-50%);
  width: 480px; height: 280px;
  background: radial-gradient(ellipse, var(--pp20) 0%, transparent 70%);
  pointer-events: none;
}
/* 大标题：主题色渐变 */
.poster.ec-blue .poster-title {
  order: 1;
  text-align: center;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: -1px;
  background: var(--poster-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.poster.ec-blue .poster-subtitle {
  order: 2;
  text-align: center;
  font-weight: var(--subtitle-weight);
  font-style: var(--subtitle-style);
  color: #ffffff;
  margin-top: 6px;
  letter-spacing: 2px;
}
.poster.ec-blue .poster-cover {
  order: 3;
  border-radius: var(--image-radius);
  border: 1px solid var(--pp20);
  margin-top: 36px;
}
.poster.ec-blue .hero-body {
  order: 4;
  text-align: center;
  color: #b8c4d2;
  line-height: 1.9;
  margin: 20px 0 0;
}
/* Sections */
.poster.ec-blue .poster-section {
  padding: 52px 48px;
  background: var(--poster-bg);
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--pp08);
  margin-top: var(--section-gap);
}
.poster.ec-blue .section-title-row {
  display: block;
  margin-bottom: 0;
}
.poster.ec-blue .section-number {
  display: var(--number-display);
  background: var(--pp12);
  color: var(--poster-primary-solid);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  min-width: 28px;
  height: 28px;
  margin-bottom: 12px;
}
/* 分标题：主题色 */
.poster.ec-blue .section-title {
  font-weight: var(--section-title-weight);
  font-style: var(--section-title-style);
  width: fit-content;
  padding-right: 0.2em; /* 给斜体字形留出右侧溢出空间，防止 background-clip 裁切 */
  color: transparent;
  background: var(--poster-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1.35;
}
.poster.ec-blue .section-body {
  color: #b8c4d2;
  font-size: var(--body-size);
  line-height: 1.9;
  margin-top: 8px;
}
.poster.ec-blue .image-grid { margin-top: 28px; }
.poster.ec-blue .image-frame {
  border-radius: var(--image-radius);
  background: rgba(0, 20, 70, .8);
  border: 1px solid var(--pp15);
}
.poster.ec-blue .image-caption { color: #64748b; font-size: 13px; text-align: center; }
/* Subsections */
.poster.ec-blue .poster-subsections {
  border-left: none;
  padding-left: 0;
  margin-top: 22px;
}
.poster.ec-blue .poster-subsection { padding-top: 14px; }
.poster.ec-blue .subsection-title-row { margin-bottom: 8px; }
.poster.ec-blue .subsection-number {
  background: var(--pp15);
  color: var(--poster-primary-solid);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  width: auto; height: auto; min-width: 0;
  padding: 2px 9px;
}
.poster.ec-blue .subsection-title { color: #e2e8f0; margin: 0; }
.poster.ec-blue .subsection-body { color: #b8c4d2; }
/* Footer */
.poster.ec-blue .poster-footer {
  padding: 32px 48px 40px;
  border-top: 1px solid var(--pp08);
  background: transparent;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  margin-top: 0;
}
.poster.ec-blue .footer-text { color: #475569; font-size: 12px; text-align: center; }

/* ── 纯黑产品长图 (ec-black) ── */
.poster.ec-black {
  --poster-title: #ffffff;
  --poster-text: rgba(255,255,255,.78);
  --poster-muted: rgba(255,255,255,.45);
  --poster-soft-line: rgba(255,255,255,.08);
}
.poster.ec-black .poster-inner {
  padding: 0;
  background: var(--poster-bg);
}
/* Hero */
.poster.ec-black .poster-hero {
  padding: 64px 48px 56px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
}
.poster.ec-black .poster-title    { order: 1; }
.poster.ec-black .poster-subtitle { order: 2; }
.poster.ec-black .poster-cover    { order: 3; }
.poster.ec-black .hero-body       { order: 4; }
.poster.ec-black .poster-title {
  text-align: center;
  color: #ffffff;
  letter-spacing: -1px;
}
.poster.ec-black .poster-subtitle {
  text-align: center;
  font-weight: var(--subtitle-weight);
  font-style: var(--subtitle-style);
  color: rgba(255,255,255,.6);
  margin-top: 6px;
  letter-spacing: 2px;
}
.poster.ec-black .hero-body {
  text-align: center;
  color: rgba(255,255,255,.5);
  line-height: 1.9;
  margin: 20px 0 0;
}
.poster.ec-black .poster-cover {
  border-radius: var(--image-radius);
  border: 1px solid rgba(255,255,255,.12);
  margin-top: 36px;
}
/* Sections */
.poster.ec-black .poster-section {
  padding: 52px 48px;
  background: transparent;
  border: none;
  border-radius: 0;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: var(--section-gap);
}
.poster.ec-black .poster-section:nth-child(even) {
  background: rgba(255,255,255,.025);
}
.poster.ec-black .section-title-row {
  display: block;
  margin-bottom: 0;
}
.poster.ec-black .section-number {
  display: var(--number-display);
  background: var(--pp12);
  color: var(--poster-primary-solid);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  min-width: 28px;
  height: 28px;
  margin-bottom: 12px;
}
.poster.ec-black .section-title {
  font-weight: var(--section-title-weight);
  font-style: var(--section-title-style);
  color: #ffffff;
  margin: 0;
  line-height: 1.35;
}
.poster.ec-black .section-body {
  color: rgba(255,255,255,.65);
  font-size: var(--body-size);
  line-height: 1.9;
  margin-top: 8px;
}
.poster.ec-black .image-grid { margin-top: 28px; }
.poster.ec-black .image-frame {
  border-radius: var(--image-radius);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.poster.ec-black .image-caption {
  color: rgba(255,255,255,.4);
  font-size: 13px;
  text-align: center;
}
/* Subsections */
.poster.ec-black .poster-subsections { border-left: none; padding-left: 0; margin-top: 22px; }
.poster.ec-black .poster-subsection  { padding-top: 14px; }
.poster.ec-black .subsection-title-row { margin-bottom: 8px; }
.poster.ec-black .subsection-number {
  background: var(--pp15);
  color: var(--poster-primary-solid);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  width: auto; height: auto; min-width: 0;
  padding: 2px 9px;
}
.poster.ec-black .subsection-title { color: #ffffff; margin: 0; }
.poster.ec-black .subsection-body  { color: rgba(255,255,255,.6); }
/* Footer */
.poster.ec-black .poster-footer {
  padding: 32px 48px 40px;
  border-top: 1px solid rgba(255,255,255,.06);
  background: #080808;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  margin-top: 0;
}
.poster.ec-black .footer-text { color: rgba(255,255,255,.35); font-size: 12px; text-align: center; }
.poster.ec-black .brand-image,
.poster.ec-black .qr-image    { filter: brightness(0.7); }

/* ── 渐变色选择器 UI (PS 滑块风格) ── */

/* 标签行：label + 渐变切换按钮 */
.grad-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.grad-label-row label { margin: 0; }

/* 渐变切换按钮（胶囊形） */
.grad-toggle-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 10px;
  line-height: 20px;
  border-radius: 20px;
  border: 1px solid rgba(116, 139, 163, .32);
  background: rgba(255, 255, 255, .72);
  color: var(--muted, #94a3b8);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.grad-toggle-pill:hover  { border-color: rgba(20,115,255,.35); color: #1473ff; }
.grad-toggle-pill.active { background: rgba(20,115,255,.12); border-color: rgba(20,115,255,.45); color: #1473ff; }

/* 纯色模式行 */
.grad-solid-row { display: flex; align-items: center; }
.grad-solid-row .color-card { flex: 1; min-width: 0; }

/* ── PS 渐变滑块组件 ── */
.grad-widget { display: flex; flex-direction: column; gap: 6px; }

/* 渐变预览条 */
.grad-slider-wrap { display: flex; flex-direction: column; }
.grad-slider-bar {
  height: 22px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(90deg, #aaa, #ddd); /* 由 JS 覆盖 */
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}
/* 色标轨道（紧贴渐变条下方） */
.grad-slider-handles {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 4px;
  background: rgba(116,139,163,.07);
  border: 1px solid rgba(116,139,163,.18);
  border-top: none;
  border-radius: 0 0 5px 5px;
  min-height: 26px;
}
/* 单个色标手柄 */
.grad-stop-handle {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 0 2px;
  transition: opacity .1s;
}
.grad-stop-handle:hover { opacity: .85; }
/* 指向渐变条的三角箭头 */
.gsh-arrow {
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 7px solid rgba(116,139,163,.55);
  margin-top: 1px;
  transition: border-bottom-color .12s;
}
/* 色标颜色方块 */
.gsh-box {
  width: 14px;
  height: 13px;
  border-radius: 2px;
  background: #888;
  border: 2px solid #fff;
  outline: 1px solid rgba(116,139,163,.4);
  transition: outline-color .12s;
  margin-top: -1px;
}
/* 选中状态高亮 */
.grad-stop-handle.selected .gsh-arrow  { border-bottom-color: #1473ff; }
.grad-stop-handle.selected .gsh-box    { outline: 2px solid #1473ff; }
.grad-stop-handle:hover    .gsh-arrow  { border-bottom-color: rgba(20,115,255,.6); }

/* 当前选中色标的信息行 */
.grad-stop-editor {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  background: rgba(20,115,255,.03);
  border: 1px solid rgba(116,139,163,.14);
  border-radius: 8px;
}
/* 选中色标的色块预览 */
.gse-swatch {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  flex-shrink: 0;
  cursor: default;
}
/* 选中色标的颜色值文本 */
.gse-value {
  flex: 1;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: #405060;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 方向按钮行 */
.gse-angles { display: flex; gap: 3px; }

/* 渐变方向按钮 */
.gang {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(116, 139, 163, .25);
  background: rgba(255, 255, 255, .7);
  color: #405060;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .12s, border-color .12s, color .12s;
}
.gang:hover  { background: rgba(20,115,255,.1);  border-color: rgba(20,115,255,.3); color: #1473ff; }
.gang.active { background: rgba(20,115,255,.14); border-color: rgba(20,115,255,.5); color: #1473ff; font-weight: 700; }

/* V3：AI 模式标记 */
.ai-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 8px;
  background: linear-gradient(135deg, #0a84ff, #6a7cff);
  color: #fff; font-weight: 700; flex-shrink: 0;
}
.ai-badge.hidden { display: none; }

/* V2：色板预览 */
.ref-preview { padding: 8px 0; }
.swatch-row { display: flex; gap: 8px; align-items: center; }
.swatch-chip {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, .08);
}
.swatch-chip.hidden, .card-flag.hidden { display: none; }
.card-flag {
  font-size: 12px; padding: 2px 8px; border-radius: 10px;
  background: var(--primary); color: #fff;
}

@media (max-width: 1180px) {
  .main { grid-template-columns: minmax(200px, 420px) 1fr; }
  .right-tools { grid-column: 1 / -1; height: auto; max-height: 42vh; border-left: none; border-top: 1px solid rgba(255, 255, 255, .62); }
}

@media (max-width: 960px) {
  .app { height: auto; min-height: 100vh; overflow: visible; }
  .main { overflow: visible; }
  .main { grid-template-columns: 1fr; }
  .editor, .preview-wrap, .right-tools { height: auto; max-height: none; overflow: visible; }
  .editor { border-right: none; border-bottom: 1px solid rgba(255, 255, 255, .62); }
  .right-tools { grid-column: auto; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .toolbar { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .preview-wrap { padding: 16px; }
  .poster-inner { padding: 36px 24px 34px; }
  .two-cols, .three-cols, .format-grid { grid-template-columns: 1fr; }
  .brand { min-width: 0; }
}

/* ── Editor ↔ Poster sync highlight ── */

@keyframes syncFlashBg {
  0%   { background-color: rgba(20, 115, 255, .11); }
  100% { background-color: transparent; }
}

.sync-flash {
  animation: syncFlashBg .75s ease-out forwards;
  border-radius: 10px;
}

.poster-section.sync-flash { border-radius: 10px; }
.poster-subsection.sync-flash { border-radius: 8px; }

/* ── Module hierarchy (editor) ── */
.module-group { display: grid; gap: 4px; }

/* Parent card — blue identity, visually dominant */
.module-group > .module-card {
  border-color: rgba(20, 115, 255, .22);
}

.module-group > .module-card > .module-head {
  background: linear-gradient(90deg, rgba(20, 115, 255, .08), transparent);
}

/* Children zone — indented beneath parent */
.child-modules-list {
  margin-left: 18px;
  padding: 4px 0 6px 14px;
  border-left: 2px solid rgba(20, 115, 255, .18);
  display: grid;
  gap: 5px;
}

/* Child card — flat, compact, clearly secondary */
.module-card.child-card {
  background: rgba(248, 250, 253, .88);
  border-color: rgba(116, 139, 163, .18);
  box-shadow: 0 2px 8px rgba(62, 80, 103, .06);
  border-radius: 14px;
}

.module-card.child-card .module-head {
  background: transparent;
  min-height: 38px;
  padding: 7px 10px;
}

.module-card.child-card .module-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.module-card.child-card.active {
  background: rgba(255, 255, 255, .96);
  border-color: rgba(112, 92, 255, .34);
  box-shadow: 0 4px 18px rgba(112, 92, 255, .10);
}

.module-card.child-card.active .module-title {
  color: var(--text);
}

/* Expand toggle */
.module-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

/* 手风琴：折叠卡片整行可点、展开/收起小三角 */
.module-card.collapsed-card > .module-head {
  cursor: pointer;
  border-radius: 18px;   /* 折叠时头部即全部，四角都圆 */
  border-bottom: none;   /* 无内容时去掉分隔线，避免双边框 */
  padding: 7px 14px;     /* 比展开态更紧凑 */
  min-height: 40px;
}
.module-card.child-card.collapsed-card > .module-head {
  border-radius: 14px;
  padding: 5px 10px;
  min-height: 34px;
}
.module-caret,
.panel-caret {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 16px;
  transition: transform .18s;
  user-select: none;
  cursor: pointer;
}
.module-card.collapsed-card .module-caret { transform: rotate(-90deg); }

/* 基础内容面板手风琴 */
.basic-panel .panel-head { cursor: pointer; gap: 8px; }
.basic-panel.collapsed .panel-caret { transform: rotate(-90deg); }
.basic-panel.collapsed .panel-body { display: none; }

.expand-toggle {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(116, 139, 163, .28);
  background: rgba(255, 255, 255, .7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex: 0 0 auto;
  cursor: pointer;
  transition: transform .18s;
}

.expand-toggle.collapsed { transform: rotate(-90deg); }

/* Add child button */
.add-child-btn {
  height: 30px;
  border-radius: 10px;
  border: 1.5px dashed rgba(116, 139, 163, .32);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 0 12px;
  cursor: pointer;
  width: 100%;
  transition: background .14s, border-color .14s, color .14s;
}

.add-child-btn:hover {
  background: rgba(112, 92, 255, .07);
  border-color: rgba(112, 92, 255, .45);
  color: #6b5bd6;
}

/* ── Child subsections (poster) ── */
.poster-subsections {
  margin-top: 22px;
  padding-left: 22px;
  border-left: 1.5px solid color-mix(in srgb, var(--poster-primary) 32%, transparent);
  display: grid;
  gap: calc(var(--section-gap) * .65);
}

.poster-subsection {
  transition: opacity .14s, transform .14s;
}

.poster-subsection[draggable="true"] { cursor: grab; }

.poster-subsection.drag-over {
  transform: translateY(6px);
  opacity: .68;
}

.subsection-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.subsection-number {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid var(--poster-primary);
  color: var(--poster-primary);
  display: var(--number-display);
  align-items: center;
  justify-content: center;
  font-weight: 760;
  font-size: 12px;
  flex: 0 0 auto;
}

.subsection-title {
  margin: 0;
  color: var(--poster-title);
  font-size: calc(var(--body-size) + 5px);
  font-weight: var(--section-title-weight);
  font-style: var(--section-title-style);
  line-height: 1.28;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-align: justify;
}

.subsection-body {
  color: var(--poster-muted);
  font-size: var(--body-size);
  font-weight: var(--body-weight);
  font-style: var(--body-style);
  text-indent: var(--body-indent, 0);
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: justify;
}

/* ── Custom color picker ── */
.cp-popup {
  position: fixed;
  z-index: 300;
  width: 240px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid rgba(200, 212, 225, .55);
  box-shadow: 0 24px 60px rgba(20, 35, 55, .22);
  display: grid;
  gap: 10px;
}

.cp-sv-field {
  height: 138px;
  border-radius: 10px;
  position: relative;
  cursor: crosshair;
  overflow: hidden;
  user-select: none;
}

.cp-sv-base, .cp-sv-white, .cp-sv-dark {
  position: absolute;
  inset: 0;
}

.cp-sv-white { background: linear-gradient(to right, #fff, transparent); }
.cp-sv-dark  { background: linear-gradient(to bottom, transparent, #000); }

.cp-sv-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cp-hue-track {
  height: 12px;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(to right,
    hsl(0,100%,50%), hsl(30,100%,50%), hsl(60,100%,50%),
    hsl(90,100%,50%), hsl(120,100%,50%), hsl(150,100%,50%),
    hsl(180,100%,50%), hsl(210,100%,50%), hsl(240,100%,50%),
    hsl(270,100%,50%), hsl(300,100%,50%), hsl(330,100%,50%),
    hsl(360,100%,50%));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}

.cp-hue-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cp-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-swatch-preview {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(116, 139, 163, .22);
  flex-shrink: 0;
}

.cp-hex-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(116, 139, 163, .28);
  border-radius: 11px;
  background: rgba(248, 250, 253, .9);
  transition: border-color .15s, box-shadow .15s;
}

.cp-hex-field:focus-within {
  border-color: rgba(20, 115, 255, .5);
  box-shadow: 0 0 0 3px rgba(20, 115, 255, .10);
}

.cp-hex-hash {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.cp-hex-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: "Menlo", "Consolas", monospace;
  letter-spacing: .06em;
  outline: none;
  min-width: 0;
  text-transform: uppercase;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(24, 35, 50, .46);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay[hidden] { display: none; }

.modal-box {
  width: min(560px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .82);
  box-shadow: 0 32px 80px rgba(30, 45, 64, .28);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-title { font-size: 17px; font-weight: 760; }

.modal-body {
  padding: 20px;
  display: grid;
  gap: 22px;
}

.modal-section { display: grid; gap: 10px; }

.modal-section-title {
  font-size: var(--ui-title-size);
  font-weight: 760;
  color: var(--text);
}

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  height: 36px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(116, 139, 163, .32);
  background: rgba(255, 255, 255, .72);
  color: var(--text);
  font-size: var(--ui-size);
  font-weight: 650;
  cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
}

.chip.active {
  border-color: var(--primary);
  background: rgba(20, 115, 255, .12);
  color: #0c63d4;
}

.modal-footer {
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.export-progress {
  flex: 1 1 auto;
  font-size: 12px;
  color: var(--muted);
}
