/* ===== 理芙谜官网可视化编辑器 CSS ===== */

/* 开关按钮 */
.editor-toggle-btn {
  position: fixed; bottom: 24px; right: 24px;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--brand-blue); color: #fff;
  border: none; cursor: pointer; font-size: 20px;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,37,85,0.25);
  transition: var(--ease);
  display: flex; align-items: center; justify-content: center;
}
.editor-toggle-btn:hover { background: var(--brand-blue-dark); transform: scale(1.08); }
.editor-toggle-btn.open { background: var(--text); }

/* 侧面板 */
.editor-panel {
  position: fixed; top: 0; right: -420px;
  width: 400px; height: 100vh;
  background: var(--surface); z-index: 9998;
  box-shadow: -4px 0 40px rgba(0,0,0,0.12);
  transition: right 0.4s cubic-bezier(0.16,1,0.3,1);
  overflow-y: auto; display: flex; flex-direction: column;
}
.editor-panel.open { right: 0; }

.editor-panel-header {
  position: sticky; top: 0; background: var(--surface);
  padding: 24px; border-bottom: 1px solid var(--border); z-index: 2;
}
.editor-panel-header h3 { font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.editor-panel-header p { font-size: 12px; color: var(--text-muted); margin: 0; }

/* 板块列表 */
.editor-section-list { flex: 1; padding: 12px 0; overflow-y: auto; }

.editor-section-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px; cursor: grab;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s; user-select: none;
}
.editor-section-item:hover { background: var(--cream); }
.editor-section-item.dragging { opacity: 0.5; background: var(--brand-blue); color: #fff; }
.editor-section-item .drag-handle { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.editor-section-item .section-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); }
.editor-section-item .section-actions { display: flex; gap: 6px; flex-shrink: 0; }
.editor-section-item .section-actions button {
  width: 28px; height: 28px; border: none; border-radius: 6px; cursor: pointer;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--cream); color: var(--text-secondary); transition: all 0.2s;
}
.editor-section-item .section-actions button:hover { background: var(--brand-blue); color: #fff; }
.editor-section-item.hidden { opacity: 0.4; }
.editor-section-item.hidden .section-name { text-decoration: line-through; }

/* 底部按钮 */
.editor-panel-footer {
  padding: 16px 24px; display: flex; gap: 8px; flex-wrap: wrap;
  position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border);
}
.editor-panel-footer button {
  padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer;
  font-size: 12px; font-weight: 500; font-family: inherit; transition: var(--ease);
}
.btn-export { background: var(--brand-blue); color: #fff; }
.btn-export:hover { background: var(--brand-blue-dark); }
.btn-import { background: var(--cream); color: var(--text); }
.btn-import:hover { background: var(--border); }
.btn-reset { background: transparent; color: var(--text-muted); border: 1px solid var(--border) !important; }
.btn-reset:hover { background: var(--cream); }
.btn-palette { background: linear-gradient(135deg, var(--brand-blue), var(--brand-gold)); color: #fff; }
.btn-palette:hover { opacity: 0.85; }

/* 配色板模态框 */
.palette-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 10000; display: none; align-items: center; justify-content: center;
}
.palette-modal.open { display: flex; }
.palette-modal-content {
  background: var(--surface); border-radius: 16px; padding: 32px;
  max-width: 440px; width: 90%; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.palette-modal-content h3 { font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 20px; }
.palette-color-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.palette-color-row label { width: 120px; font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }
.palette-color-row input[type="color"] { width: 40px; height: 32px; border: none; border-radius: 6px; cursor: pointer; padding: 0; background: transparent; }
.palette-color-row input[type="text"] { flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text); font-family: monospace; background: var(--cream); }
.palette-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }
.palette-actions button { padding: 8px 20px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; font-family: inherit; }
.palette-actions .btn-apply { background: var(--brand-blue); color: #fff; }
.palette-actions .btn-cancel { background: var(--cream); color: var(--text-secondary); }

/* 文案编辑模态框 */
.edit-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 10000; display: none; align-items: center; justify-content: center;
}
.edit-modal.open { display: flex; }
.edit-modal-content {
  background: var(--surface); border-radius: 16px; padding: 32px;
  max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.edit-modal-content h3 { font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 20px; }
.edit-field { margin-bottom: 16px; }
.edit-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.edit-field label code { font-weight: 400; color: var(--text-muted); text-transform: none; font-size: 11px; }
.edit-field input, .edit-field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--text); box-sizing: border-box;
}
.edit-field textarea { min-height: 80px; resize: vertical; }
.edit-field input:focus, .edit-field textarea:focus { border-color: var(--brand-blue); outline: none; box-shadow: 0 0 0 3px rgba(0,61,140,0.08); }

/* 图片编辑浮层 */
.editor-img-wrapper { position: relative; display: inline-block; }
.editor-img-wrapper .img-edit-overlay {
  position: absolute; inset: 0; background: rgba(0,61,140,0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.25s; cursor: pointer; border-radius: inherit; z-index: 9990;
}
.editor-img-wrapper:hover .img-edit-overlay { opacity: 1; }
.editor-img-wrapper .img-edit-overlay span {
  background: #fff; color: var(--brand-blue); padding: 6px 14px;
  border-radius: 6px; font-size: 12px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Toast 提示 */
.editor-toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 24px; border-radius: 8px;
  font-size: 13px; z-index: 10001; pointer-events: none;
  opacity: 0; transition: opacity 0.3s;
}
.editor-toast.show { opacity: 1; }
