/* 文章编辑弹窗 — lesson-editor.js 配套 CSS */
/* 独立样式，不依赖宿主页面 CSS 变量 */

.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 1000; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff; border-radius: 8px;
  width: 90%; max-width: 800px; max-height: 90vh; overflow-y: auto;
  padding: 24px; box-shadow: 0 8px 32px rgba(0,0,0,.15);
}
.modal h2 { margin: 0 0 16px; font-size: 18px; color: #1e293b; }
.modal label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 13px; color: #64748b; }
.modal input[type="text"], .modal textarea, .modal select {
  width: 100%; padding: 8px 12px; border: 1px solid #e2e8f0;
  border-radius: 8px; font-size: 14px; font-family: inherit; box-sizing: border-box;
}
.modal textarea { min-height: 400px; font-family: 'SF Mono','Fira Code','Consolas',monospace; font-size: 13px; line-height: 1.5; resize: vertical; }
.modal .form-row { display: flex; gap: 12px; }
.modal .form-row > * { flex: 1; }
.modal .btn-row { margin-top: 16px; display: flex; gap: 8px; justify-content: flex-end; }
.modal .btn-row button { padding: 8px 20px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.modal .btn-row .cancel { background: #f1f5f9; border: 1px solid #e2e8f0; color: #1e293b; }
.modal .btn-row .save { background: #3b82f6; color: #fff; border: none; }
.modal .btn-row .save:hover { background: #2563eb; }

/* toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; padding: 10px 20px;
  border-radius: 8px; color: #fff; font-size: 14px;
  z-index: 2000; animation: fadeIn .3s;
}
.toast.success { background: #22c55e; }
.toast.error { background: #ef4444; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* preview 切换 */
.preview-toggle { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: 12px; color: #3b82f6; margin: 4px 0; }
.preview-toggle:hover { text-decoration: underline; }
