/* =============================================
   编辑器界面样式（深色科技感）
   - 不用 Tailwind，避免依赖
   - 颜色与微信公众号内嵌样式隔离
   ============================================= */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 苹方繁细体, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', -apple-system, sans-serif;
  color: #1a1a1a;
  background: #f5f6f8;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ========== 顶栏 ========== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: #1a1a1a;
}

/* =============================================
   左栏 tab 切换条（组件 / 模板 / 关于）
   ============================================= */
.left-tabs {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
  flex-shrink: 0;
}
.left-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 4px 8px 4px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 10px;
  color: #888;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.left-tab:hover {
  color: #555;
  background: #f0f0f0;
}
.left-tab.is-active {
  color: var(--primary, #1879A5);
  border-bottom-color: var(--primary, #1879A5);
  background: #fff;
}
.left-tab-icon {
  font-size: 16px;
  line-height: 1;
}
.left-tab-label {
  font-size: 11px;
  letter-spacing: 1px;
}

/* =============================================
   模板面板
   ============================================= */
.tpl-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  align-items: center;
}
.tpl-search {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  color: #1a1a1a;
  outline: none;
}
.tpl-search:focus {
  border-color: var(--primary, #1879A5);
}

.tpl-group {
  margin-bottom: 18px;
}
.tpl-group-title {
  font-size: 10px;
  color: #999;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-left: 2px;
}
.tpl-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tpl-card:hover {
  border-color: var(--primary, #1879A5);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.tpl-card-builtin {
  border-left: 3px solid var(--primary, #1879A5);
}
.tpl-card-user {
  border-left: 3px solid #7a5a1a;
}
.tpl-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.tpl-card-name {
  font-size: 13px;
  font-weight: bold;
  color: #1a1a1a;
  letter-spacing: 0.3px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-card-meta {
  font-size: 10px;
  color: #999;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.tpl-card-desc {
  margin: 4px 0 6px 0;
  font-size: 11px;
  color: #666;
  line-height: 1.6;
  letter-spacing: 0.3px;
}
.tpl-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.tpl-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--primary, #1879A5);
  background: #f5f5f5;
  border-radius: 2px;
  letter-spacing: 0.3px;
}
.tpl-card-actions {
  display: flex;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed #eaeaea;
}
.tpl-empty-hint {
  padding: 14px;
  font-size: 11px;
  color: #999;
  background: #fafafa;
  border: 1px dashed #e0e0e0;
  border-radius: 4px;
  text-align: center;
  line-height: 1.6;
  letter-spacing: 0.3px;
}

/* =============================================
   营销/关于面板
   ============================================= */
.mkt-intro {
  text-align: center;
  padding: 14px 12px;
  background: linear-gradient(135deg, #fafafa 0%, #fff 100%);
  border: 1px dashed #e0e0e0;
  border-radius: 5px;
  margin-bottom: 16px;
}
.mkt-headline {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: bold;
  color: #1a1a1a;
  letter-spacing: 1px;
  line-height: 1.4;
}
.mkt-subline {
  margin: 0;
  font-size: 11px;
  color: #888;
  letter-spacing: 0.5px;
  line-height: 1.5;
}
.mkt-section {
  margin-bottom: 18px;
}
.mkt-section-title {
  font-size: 10px;
  color: #999;
  font-weight: bold;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #eaeaea;
}
.mkt-author {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fafafa;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #eaeaea;
}
.mkt-qr {
  width: 64px;
  height: 64px;
  background: #fff;
  border: 1px solid #eaeaea;
  display: block;
  flex-shrink: 0;
}
.mkt-qr-lg {
  width: 80px;
  height: 80px;
}
.mkt-author-info {
  flex: 1;
  min-width: 0;
}
.mkt-author-name {
  margin: 0 0 3px 0;
  font-size: 13px;
  font-weight: bold;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}
.mkt-author-bio {
  margin: 0 0 6px 0;
  font-size: 11px;
  color: #666;
  line-height: 1.5;
}
.mkt-author-tip {
  margin: 0;
  font-size: 10px;
  color: #888;
  letter-spacing: 0.5px;
}
.mkt-series-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mkt-series {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafafa;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid #eaeaea;
}
.mkt-series-name {
  margin: 0 0 2px 0;
  font-size: 12px;
  font-weight: bold;
  color: #1a1a1a;
  letter-spacing: 0.3px;
}
.mkt-series-tag {
  margin: 0;
  font-size: 10px;
  color: #888;
  letter-spacing: 0.3px;
}
.mkt-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #fafafa;
  border: 1px solid #eaeaea;
  border-radius: 4px;
  text-decoration: none;
  color: #1a1a1a;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.mkt-action:hover {
  background: #f0f0f0;
  border-color: var(--primary, #1879A5);
}
.mkt-action.is-placeholder {
  opacity: 0.55;
  cursor: default;
}
.mkt-action-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.mkt-action-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.mkt-action-label {
  font-size: 12px;
  font-weight: bold;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}
.mkt-action-desc {
  font-size: 10px;
  color: #888;
  letter-spacing: 0.3px;
}
.mkt-footer {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #eaeaea;
  font-size: 10px;
  color: #aaa;
  text-align: center;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

/* =============================================
   弹窗变体
   ============================================= */
.modal-sm {
  max-width: 460px;
}
.modal-preview {
  max-width: 720px;
  width: 90vw;
}
.modal-meta {
  font-size: 11px;
  color: #888;
  margin-left: 8px;
  font-weight: normal;
  letter-spacing: 0.5px;
}
.modal-body-preview {
  max-height: 70vh;
  overflow-y: auto;
  background: #f5f6f8;
  padding: 20px;
}
.tpl-preview-canvas {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 20px 0;
  overflow: hidden;
}
.tpl-preview-canvas .canvas-block {
  margin: 0 0 16px 0;
  border: none;
  max-width: none;
}
.tpl-preview-canvas .canvas-block:last-child {
  margin-bottom: 0;
}
.tpl-preview-canvas .canvas-block-preview {
  padding: 0 14px;
}

.modal-hint {
  margin: 12px 0 0 0;
  padding: 8px 10px;
  font-size: 11px;
  color: #888;
  background: #fafafa;
  border: 1px solid #eaeaea;
  border-radius: 3px;
  letter-spacing: 0.3px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  margin: 0;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #fff;
}

.version {
  font-size: 10px;
  color: #888;
  padding: 1px 6px;
  border: 1px solid #444;
  border-radius: 2px;
  letter-spacing: 1px;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-selector-label {
  font-size: 12px;
  color: #999;
}

.theme-selector select {
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  min-width: 200px;
}

.theme-selector select:focus {
  outline: none;
  border-color: #1879A5;
}

.theme-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid #444;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset;
}

.topbar-right {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 6px 14px;
  font-size: 12px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.15s;
}

.btn-primary {
  background: #1879A5;
  color: #fff;
  border-color: #1879A5;
}

.btn-primary:hover {
  background: #0e5a82;
}

.btn-ghost {
  background: transparent;
  color: #ccc;
  border-color: #444;
}

.btn-ghost:hover {
  background: #2a2a2a;
  color: #fff;
}

/* ========== 主内容区 ========== */
.main {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  flex: 1;
  overflow: hidden;
}

/* ========== 左/右栏 ========== */
.panel {
  background: #fff;
  border-right: 1px solid #eaeaea;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-right {
  border-right: none;
  border-left: 1px solid #eaeaea;
}

.panel-header {
  padding: 14px 18px;
  background: #fafafa;
  border-bottom: 1px solid #eaeaea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel-header h2 {
  margin: 0;
  font-size: 13px;
  color: #1a1a1a;
  font-weight: bold;
  letter-spacing: 1px;
}

.panel-hint {
  font-size: 10px;
  color: #999;
  letter-spacing: 0.5px;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.panel-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 12px;
  line-height: 1.85;
}

.panel-empty p {
  margin: 6px 0;
}

/* ========== 组件库分组 ========== */
.component-group {
  margin-bottom: 18px;
}

.component-group-title {
  font-size: 11px;
  color: #999;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 0 4px 8px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 8px;
}

.component-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.component-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: #fafafa;
  border: 1px solid #eaeaea;
  border-radius: 3px;
  cursor: grab;
  user-select: none;
  transition: all 0.15s;
  font-size: 12px;
  color: #2c2c2c;
}

.component-item:hover {
  background: #fff;
  border-color: #1879A5;
  color: #1879A5;
}

.component-item:active {
  cursor: grabbing;
  background: #e8f3f8;
}

.component-item-icon {
  margin-right: 8px;
  font-size: 14px;
  width: 16px;
  text-align: center;
}

.component-item-name {
  flex: 1;
  font-weight: 500;
}

.component-item-tag {
  font-size: 9px;
  padding: 1px 4px;
  background: #e3a34b;
  color: #fff;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

/* ========== 中间画布 ========== */
.canvas-wrap {
  display: flex;
  flex-direction: column;
  background: #f5f6f8;
  overflow: hidden;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid #eaeaea;
  flex-shrink: 0;
}

.canvas-title {
  font-size: 12px;
  font-weight: bold;
  color: #1a1a1a;
  letter-spacing: 1px;
}

.canvas-meta {
  font-size: 11px;
  color: #888;
}

.canvas {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f5f6f8;
  transition: background 0.15s;
}

.canvas.is-dragover {
  background: #e8f3f8;
}

.canvas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 70vh;
  color: #999;
  border: 2px dashed #d0d0d0;
  border-radius: 6px;
  background: #fff;
  gap: 10px;
}

.canvas-empty-icon {
  font-size: 48px;
  margin-bottom: 4px;
  opacity: 0.3;
}

.canvas-empty-text {
  font-size: 13px;
  letter-spacing: 1px;
}

.canvas-empty-hint {
  font-size: 11px;
  color: #bbb;
  letter-spacing: 0.5px;
}

/* ========== 画布顶部提示条 ========== */
.canvas-hint {
  padding: 8px 16px;
  background: #fdf4e3;
  border-bottom: 1px solid #f0e0c0;
  font-size: 11px;
  color: #b67d2c;
  text-align: center;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

/* ========== 画布块 wrapper（落点定位上下文） ========== */
.canvas-block-wrapper {
  max-width: 480px;
  margin: 0 auto 18px;
  position: relative;
  /* 无内容时（如只剩指示器）仍占正常高度 */
}
.canvas-block-wrapper:last-child {
  margin-bottom: 18px;
}

.canvas-block {
  max-width: 480px;
  /* margin 移到 wrapper 上，避免与指示器重叠错位 */
  margin: 0;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.canvas-block:hover {
  border-color: #d0d0d0;
}

.canvas-block.is-selected {
  border-color: #1879A5;
  box-shadow: 0 0 0 1px #1879A5;
}

/* ========== 落点指示器（拖拽时显示） ========== */
.canvas-drop-indicator {
  position: absolute;
  top: -11px;            /* 落在 wrapper 顶部上方，视觉上与上方空白融合 */
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  z-index: 10;
  pointer-events: none;
  animation: drop-indicator-pulse 1.2s ease-in-out infinite;
}
.canvas-drop-indicator-label {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 2px;
  white-space: nowrap;
  letter-spacing: 1px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.canvas-drop-indicator-end {
  position: relative;     /* 不在 wrapper 内，不能 absolute */
  top: auto;
  left: auto;
  right: auto;
  max-width: 480px;
  margin: 0 auto 18px;    /* 沿用 wrapper 的间距 */
  /* height/background/animation 继承自基础类 */
}
@keyframes drop-indicator-pulse {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}

.canvas-block-bar {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: #fafafa;
  border-bottom: 1px solid #eaeaea;
  font-size: 11px;
  color: #555;
}

.canvas-block-idx {
  color: #999;
  margin-right: 6px;
  font-weight: bold;
}

.canvas-block-name {
  flex: 1;
  font-weight: 500;
  color: #1a1a1a;
}

.canvas-block-actions {
  display: flex;
  gap: 2px;
}

.canvas-block-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #888;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.canvas-block-btn:hover:not(:disabled) {
  background: #eaeaea;
  color: #1a1a1a;
}

.canvas-block-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.canvas-block-btn-danger:hover {
  background: #fee;
  color: #c00;
}

.canvas-block-preview {
  background: #fff;
}

.canvas-block-preview > * {
  margin: 0 !important;
}

/* ========== 右栏表单 ========== */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  color: #555;
  font-weight: bold;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid #eaeaea;
  border-radius: 3px;
  background: #fff;
  color: #1a1a1a;
  font-family: inherit;
  resize: vertical;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #1879A5;
}

.form-group input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 2px;
  cursor: pointer;
  border: 1px solid #eaeaea;
  border-radius: 3px;
}

.form-static {
  padding: 6px 10px;
  font-size: 12px;
  background: #fafafa;
  border: 1px solid #eaeaea;
  border-radius: 3px;
  color: #555;
}

/* ========== src 字段专用（图片上传） ========== */
.src-actions {
  margin-top: 6px;
}

.btn-mini {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  background: #fafafa;
  border: 1px solid #eaeaea;
  border-radius: 3px;
  cursor: pointer;
  color: #555;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}

.btn-mini:hover {
  background: #e8f3f8;
  border-color: #1879A5;
  color: #1879A5;
}

.src-preview {
  margin-top: 6px;
  padding: 6px;
  background: #fafafa;
  border: 1px solid #eaeaea;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.src-preview img {
  max-width: 100%;
  max-height: 120px;
  display: block;
  border-radius: 2px;
}

.src-url {
  margin: 0;
  font-size: 11px;
  color: #888;
  letter-spacing: 0.5px;
}

/* ========== 状态栏 ========== */
.statusbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 28px;
  background: #1a1a1a;
  color: #888;
  font-size: 11px;
  flex-shrink: 0;
  border-top: 1px solid #333;
}

.statusbar-item {
  letter-spacing: 0.5px;
}

.statusbar-hint {
  margin-left: auto;
  color: #e3a34b;
}

/* ========== Modal ========== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: #fff;
  border-radius: 6px;
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #fafafa;
  border-bottom: 1px solid #eaeaea;
}

.modal-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
  color: #1a1a1a;
  letter-spacing: 1px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #888;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 3px;
}

.modal-close:hover {
  background: #eaeaea;
  color: #1a1a1a;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #eaeaea;
  margin-bottom: 16px;
}

.modal-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 12px;
  color: #888;
  letter-spacing: 1px;
  font-weight: 500;
}

.modal-tab:hover {
  color: #1a1a1a;
}

.modal-tab.is-active {
  color: #1879A5;
  border-bottom-color: #1879A5;
}

.modal-preview-wrap {
  background: #f5f6f8;
  padding: 20px;
  border-radius: 3px;
  border: 1px solid #eaeaea;
}

.modal-preview {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #eaeaea;
}

.modal-source {
  background: #1a1a1a;
  color: #e0e0e0;
  padding: 16px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.6;
  overflow-x: auto;
  max-height: 50vh;
  font-family: SF Mono, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

.modal-tips {
  margin-top: 18px;
  padding: 14px 18px;
  background: #fff8e1;
  border-left: 3px solid #e3a34b;
  border-radius: 3px;
  font-size: 12px;
  color: #555;
  line-height: 1.85;
}

.modal-warning {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fff0f0;
  border-left: 3px solid #c0392b;
  border-radius: 3px;
  font-size: 12px;
  color: #555;
  line-height: 1.85;
}

.modal-warning p {
  margin: 0 0 4px 0;
}

.modal-warning p:last-child {
  margin: 0;
}

.modal-warning strong {
  color: #c0392b;
}

.modal-warning code {
  background: #fff;
  padding: 1px 5px;
  border: 1px solid #e0c0c0;
  border-radius: 2px;
  font-family: SF Mono, Consolas, monospace;
  font-size: 11px;
  color: #c0392b;
}

/* base64 批量替换面板 */
.base64-replace-list {
  margin-top: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.base64-replace-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #fff;
  padding: 6px 8px;
  border: 1px solid #e0c0c0;
  border-radius: 3px;
}
.base64-replace-label {
  font-size: 11px;
  color: #c0392b;
  font-weight: bold;
  letter-spacing: 0.3px;
}
.base64-replace-input {
  width: 100%;
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 2px;
  background: #fff;
  color: #1a1a1a;
  font-family: SF Mono, Consolas, monospace;
}
.base64-replace-input:focus {
  outline: none;
  border-color: #c0392b;
}
.btn.btn-warning {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}
.btn.btn-warning:hover {
  background: #a8311f;
  border-color: #a8311f;
}

.modal-tips p {
  margin: 0 0 8px 0;
  font-weight: bold;
  color: #1a1a1a;
}

.modal-tips ol {
  margin: 0;
  padding-left: 20px;
}

.modal-tips kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-family: SF Mono, Consolas, monospace;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 2px;
  box-shadow: 0 1px 0 #ccc;
  margin: 0 1px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  background: #fafafa;
  border-top: 1px solid #eaeaea;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  border-radius: 4px;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  letter-spacing: 1px;
  animation: toastIn 0.25s ease-out;
}

.toast-success {
  background: #1f8a73;
}

.toast-error {
  background: #c0392b;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}

/* =============================================
   封面图模块（V1）
   ============================================= */

/* 封面画布容器（在中间区域） */
.canvas-wrap-cover {
  padding: 24px;
}

.cover-canvas {
  margin: 0 auto;
  border-radius: 8px;
  background: #1a1a1a;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  position: relative;
}

.cover-frame {
  width: 100%;
  height: 100%;
}

/* 封面按钮区域（左栏底部） */
.cover-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 封面提示文字 */
.cover-hint {
  font-size: 11px;
  line-height: 1.6;
  color: #888;
  margin: 0;
}

/* ========== 封面图片上传控件 ========== */
.cover-upload-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- 有图片时：预览模式 --- */
.cover-upload-preview {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  transition: all 0.15s;
}

.cover-thumb {
  width: 100px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  background: #1a1a1a;
  cursor: pointer;
  flex-shrink: 0;
  border: 1px solid #ddd;
}

.cover-upload-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.cover-upload-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #555;
}

.upload-icon {
  font-size: 14px;
}

.cover-upload-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.upload-btn-mini {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  line-height: 1.4;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 3px;
  cursor: pointer;
  color: #555;
  white-space: nowrap;
  transition: all 0.15s;
}

.upload-btn-mini:hover {
  background: #e8f3f8;
  border-color: #1879A5;
  color: #1879A5;
}

.upload-btn-mini.upload-btn-clear:hover {
  background: #fde8e8;
  border-color: #c53030;
  color: #c53030;
}

/* --- 无图片时：上传区域 --- */
.cover-upload-empty {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
  border: 2px dashed #d4d4d4;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.cover-upload-empty:hover {
  border-color: #1879A5;
  background: linear-gradient(135deg, #f0f9ff 0%, #e8f3f8 100%);
}

.upload-dropzone-icon {
  font-size: 28px;
  line-height: 1;
}

.upload-dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upload-dropzone-text strong {
  font-size: 13px;
  color: #1879A5;
  font-weight: 600;
}

.upload-dropzone-text small {
  font-size: 11px;
  color: #888;
}

/* --- URL 输入 --- */
.cover-upload-url {
  margin-top: 2px;
}

.cover-upload-url .url-input {
  width: 100%;
  font-size: 11px;
  padding: 6px 10px;
  border: 1px solid #e5e5e5;
  border-radius: 3px;
  background: #ffffff;
  color: #666;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
}

.cover-upload-url .url-input::placeholder {
  color: #aaa;
}

.cover-upload-url .url-input:focus {
  border-color: #1879A5;
  outline: none;
  background: #ffffff;
}

.cover-hint-mini {
  font-size: 11px;
  line-height: 1.6;
  color: #4a9e3f;
  margin: 4px 0 0 0;
}

/* 右栏 cover 编辑的 QR 选择器 */
.qr-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.qr-option-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.qr-option-card:hover {
  background: #f0f6ff;
  border-color: #b8d4f5;
}

.qr-option-card.is-selected {
  background: #e8f2ff;
  border-color: #3478d9;
  box-shadow: 0 1px 2px rgba(52, 120, 217, 0.15);
}

.qr-option-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.qr-option-label {
  font-size: 12px;
  color: #333;
  line-height: 1.3;
}

.qr-option-card.is-selected .qr-option-label {
  color: #1a5ab0;
  font-weight: 500;
}

/* 右栏 cover 编辑的 checkbox 行 */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.checkbox-label {
  font-size: 12px;
  color: #666;
}

/* 右栏 cover 导出按钮组 */
.cover-export-block {
  margin-top: 8px;
}

.cover-export-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

/* ========== 封面 tab：主题预设卡片 ========== */
.cover-theme-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cover-theme-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.cover-theme-card:hover {
  background: #f0f6ff;
  border-color: #b8d4f5;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(52, 120, 217, 0.1);
}

.cover-theme-card:active {
  transform: translateY(0);
}

.cover-theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cover-theme-info {
  flex: 1;
  min-width: 0;
}

.cover-theme-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.cover-theme-desc {
  font-size: 11px;
  color: #888;
  line-height: 1.4;
  margin-top: 2px;
}

/* ========== 封面 tab：布局模板卡片 ========== */
.cover-layout-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cover-layout-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.cover-layout-card:hover {
  background: #f0f6ff;
  border-color: #b5d5ff;
}

.cover-layout-card.is-selected {
  background: #e8f2ff;
  border-color: #3478d9;
  box-shadow: 0 1px 2px rgba(52, 120, 217, 0.15);
}

.cover-layout-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: #fff;
  border-radius: 4px;
  flex-shrink: 0;
}

.cover-layout-card.is-selected .cover-layout-icon {
  background: #3478d9;
  color: #fff;
}

.cover-layout-info {
  flex: 1;
  min-width: 0;
}

.cover-layout-name {
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.cover-layout-desc {
  font-size: 10px;
  color: #888;
  line-height: 1.4;
}

/* ========== 封面 tab：尺寸规格卡片 ========== */
.cover-preset-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cover-preset-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.cover-preset-card:hover {
  background: #f0f6ff;
  border-color: #b5d5ff;
}

.cover-preset-card.is-selected {
  background: #e8f2ff;
  border-color: #3478d9;
  box-shadow: 0 1px 2px rgba(52, 120, 217, 0.15);
}

.cover-preset-label {
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
}

.cover-preset-size {
  font-size: 11px;
  color: #888;
  font-family: "SF Mono", Consolas, Monaco, monospace;
}

.cover-preset-card.is-selected .cover-preset-size {
  color: #3478d9;
  font-weight: 600;
}

/* ========== 右栏封面字段：QR 码选择器 ========== */
.cover-qr-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.cover-qr-option {
  text-align: center;
  padding: 6px 4px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 10px;
  color: #666;
}

.cover-qr-option:hover {
  background: #f0f6ff;
  border-color: #b5d5ff;
}

.cover-qr-option.is-selected {
  background: #e8f2ff;
  border-color: #3478d9;
  color: #3478d9;
  font-weight: 600;
}

.cover-qr-option.is-none {
  opacity: 0.7;
}

/* 右栏封面字段：字体阴影开关 */
.cover-shadow-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.cover-shadow-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.cover-shadow-toggle label {
  font-size: 11px;
  color: #666;
  margin: 0;
}
