/* ============================================================
   problem_editor.css —— 题目「所见即所得」编辑器（v14）
   ------------------------------------------------------------
   * 编辑区直接复用 .problem-content / .rich-view，因此框内排版与
     题目详情页一致（需求 9：框里什么样，页面就什么样）
   * 图片：选中描边 + 8 个缩放手柄 + 浮动工具条（宽度/对齐/删除）
   * 明暗主题跟随 theme-fresh 的 CSS 变量
   ============================================================ */

.pe-wrap {
  position: relative;
  border: 1px solid var(--border, #e2eee8);
  border-radius: 12px;
  background: var(--card-bg, #fff);
  overflow: visible;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.pe-wrap:focus-within {
  border-color: var(--primary, #3f9d8b);
  box-shadow: 0 0 0 3px rgba(63, 157, 139, .13);
}

/* ---------- 工具栏 ---------- */
.pe-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 3px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border, #e2eee8);
  background: var(--fx-mint-50, #f1faf6);
  border-radius: 12px 12px 0 0;
}
html.dark .pe-toolbar { background: rgba(255, 255, 255, .03); }

.pe-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 7px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--text, #2c443d);
  font-size: .8rem; line-height: 1;
  cursor: pointer; transition: all .14s ease;
  white-space: nowrap;
}
.pe-btn:hover {
  background: var(--card-bg, #fff);
  border-color: var(--border, #e2eee8);
  color: var(--primary, #3f9d8b);
}
.pe-btn:active { transform: translateY(1px); }
.pe-btn b, .pe-btn i, .pe-btn u, .pe-btn s { pointer-events: none; }

.pe-sep {
  width: 1px; height: 18px; margin: 0 4px;
  background: var(--border, #e2eee8); display: inline-block;
}
.pe-spacer { flex: 1 1 auto; }
.pe-btn svg { display: block; width: 15px; height: 15px; }
.pe-pbtn {
  margin-left: 2px; padding: 0 9px;
  font-size: .76rem; color: var(--primary, #3f9d8b);
  border-color: var(--border, #e2eee8); background: var(--card-bg, #fff);
}
.pe-pbtn:hover { background: var(--primary, #3f9d8b); color: #fff; border-color: var(--primary, #3f9d8b); }
.pe-hint {
  font-size: .72rem; color: var(--text-2, #7b918a);
  padding-right: 6px; white-space: nowrap;
  max-width: 16rem; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
}

/* ---------- 预览弹层（按详情页真实渲染） ---------- */
.pe-pv-mask {
  position: fixed; inset: 0; z-index: 1400;
  display: none; padding: 26px 16px; overflow: auto;
  background: rgba(16, 42, 35, .45);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.pe-pv-mask.show { display: block; }
.pe-pv-box {
  max-width: 840px; margin: 0 auto;
  background: var(--card-bg, #fff);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 26px 64px rgba(14, 44, 36, .26);
}
.pe-pv-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border, #e2eee8);
  background: var(--fx-mint-50, #f1faf6);
}
.pe-pv-head strong { font-size: .95rem; color: var(--fx-ink, #233a33); }
.pe-pv-sub { flex: 1 1 auto; font-size: .76rem; color: var(--text-2, #7b918a); }
.pe-pv-x {
  border: 0; background: transparent; cursor: pointer;
  font-size: 1.35rem; line-height: 1; color: var(--text-2, #7b918a);
  padding: 0 2px;
}
.pe-pv-x:hover { color: var(--primary, #3f9d8b); }
.pe-pv-body { padding: 18px 20px; max-height: min(68vh, 640px); overflow: auto; }
.pe-pv-content { min-height: 56px; }
.pe-pv-empty { margin: 0; color: var(--text-2, #7b918a); font-size: .88rem; }
.pe-pv-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; border-top: 1px solid var(--border, #e2eee8);
  font-size: .76rem; color: var(--text-2, #7b918a);
}
.pe-pv-ok {
  border: 1px solid var(--border, #e2eee8); border-radius: 8px;
  background: var(--card-bg, #fff); color: var(--fx-ink, #233a33);
  font-size: .8rem; padding: 5px 14px; cursor: pointer;
}
.pe-pv-ok:hover { border-color: var(--primary, #3f9d8b); color: var(--primary, #3f9d8b); }
html.dark .pe-pv-head { background: rgba(255, 255, 255, .04); }
html.dark .pe-pv-head strong, html.dark .pe-pv-ok { color: #e8f3ef; }
html.dark .pe-pv-ok { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); }
html.pe-pv-open { overflow: hidden; }

/* ---------- 编辑区 ---------- */
.pe-canvas {
  min-height: 150px;
  max-height: 620px;
  overflow: auto;
  padding: 14px 16px;
  outline: none;
  border-radius: 0 0 12px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.78;
}
.pe-canvas:empty::before,
.pe-canvas.pe-empty::before {
  content: attr(data-placeholder);
  color: var(--text-2, #7b918a);
  opacity: .72;
  pointer-events: none;
}
.pe-canvas img { max-width: 100%; height: auto; border-radius: 6px; }
.pe-canvas pre, .pe-canvas pre.pe-code {
  background: var(--code-bg, #f2f9f5);
  border: 1px solid var(--border, #e2eee8);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: .86rem;
  overflow: auto;
}
/* v43：代码块必须允许自由拖选多行、Ctrl+A、复制/剪切/删除；
   white-space:pre 保证一个 \n 只显示一个换行（避免历史「多余空行」）。 */
.pe-canvas pre.pe-code {
  white-space: pre;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
  outline: none;
}
.pe-canvas pre.pe-code:hover { border-color: var(--primary, #3f9d8b); }
.pe-canvas pre.pe-code::selection,
.pe-canvas pre.pe-code ::selection { background: rgba(63, 157, 139, .28); }

/* v43：代码块浮动工具条 */
.pe-cb-bar {
  position: fixed;
  z-index: 1300;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border-radius: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2eee8);
  box-shadow: 0 10px 28px rgba(31, 58, 48, .18);
  font-size: .76rem;
  white-space: nowrap;
}
.pe-cb-bar.is-visible { display: flex; }
.pe-cb-bar__label { color: var(--text-2, #7b918a); font-weight: 700; padding: 0 6px 0 2px; }
.pe-cb-bar button {
  font: inherit;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--border, #e2eee8);
  background: var(--fx-mint-50, #f1faf6);
  color: var(--fx-ink, #233a33);
  cursor: pointer;
}
.pe-cb-bar button:hover { border-color: var(--primary, #3f9d8b); color: var(--primary, #3f9d8b); }
.pe-cb-bar button[data-cb="delete"]:hover { border-color: #d97070; color: #c94c4c; }
html.dark .pe-cb-bar { background: #1d2f28; border-color: #35544a; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
html.dark .pe-cb-bar button { background: #233a31; color: #e8f3ef; border-color: #35544a; }
.pe-canvas blockquote {
  margin: 8px 0; padding: 6px 12px;
  border-left: 3px solid var(--primary, #3f9d8b);
  background: var(--fx-mint-50, #f1faf6);
  border-radius: 0 8px 8px 0;
  color: var(--text-2, #7b918a);
}
.pe-canvas a { color: var(--primary, #3f9d8b); }

/* v38 · Markdown 粘贴生成的块级元素
   浏览器默认的 <p>/<h*>/<ul> margin 很大，配合编辑区 line-height:1.78
   会被看成「粘贴后多出一堆空行」。这里统一收紧，块之间只留极小间距，
   真正空几行只由用户原文里的空行决定。 */
.pe-canvas p { margin: 0 0 4px; }
.pe-canvas h1, .pe-canvas h2, .pe-canvas h3,
.pe-canvas h4, .pe-canvas h5, .pe-canvas h6 {
  margin: 8px 0 4px; font-weight: 700; line-height: 1.45;
}
.pe-canvas h3 { font-size: 1.08rem; }
.pe-canvas h4 { font-size: 1.02rem; }
.pe-canvas h5, .pe-canvas h6 { font-size: .96rem; }
.pe-canvas ul, .pe-canvas ol { margin: 3px 0 5px; padding-left: 1.7em; }
.pe-canvas li { margin: 0; }
.pe-canvas table { border-collapse: collapse; margin: 5px 0; }
.pe-canvas td, .pe-canvas th {
  border: 1px solid var(--border, #e2eee8); padding: 3px 8px;
}
.pe-canvas hr { margin: 8px 0; border: 0; border-top: 1px solid var(--border, #e2eee8); }

/* 上传中状态 */
.pe-src { display: none !important; }
.pe-wrap.pe-uploading::after {
  content: '图片上传中…';
  position: absolute; right: 12px; bottom: 10px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--primary, #3f9d8b); color: #fff;
  font-size: .74rem; font-weight: 600;
}

/* ---------- 图片选中态 ---------- */
.pe-canvas img.pe-img-active {
  outline: 2px solid var(--primary, #3f9d8b);
  outline-offset: 2px;
  box-shadow: 0 4px 14px rgba(63, 157, 139, .18);
}

/* ---------- 缩放手柄 ---------- */
.pe-handles {
  position: absolute;
  border: 1px dashed var(--primary, #3f9d8b);
  border-radius: 4px;
  pointer-events: none;   /* 只有手柄本身吃事件，图片仍可点击 */
  z-index: 5;
}
.pe-h {
  position: absolute;
  width: 9px; height: 9px;
  background: #fff;
  border: 1.6px solid var(--primary, #3f9d8b);
  border-radius: 50%;
  pointer-events: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.pe-h-nw { left: -5px; top: -5px; cursor: nwse-resize; }
.pe-h-n  { left: 50%; top: -5px; margin-left: -4.5px; cursor: ns-resize; }
.pe-h-ne { right: -5px; top: -5px; cursor: nesw-resize; }
.pe-h-e  { right: -5px; top: 50%; margin-top: -4.5px; cursor: ew-resize; }
.pe-h-se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.pe-h-s  { left: 50%; bottom: -5px; margin-left: -4.5px; cursor: ns-resize; }
.pe-h-sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.pe-h-w  { left: -5px; top: 50%; margin-top: -4.5px; cursor: ew-resize; }

/* ---------- 浮动图片工具条 ---------- */
.pe-img-tools {
  position: absolute;
  z-index: 40;
  display: flex; flex-direction: column; gap: 4px;
  padding: 7px 9px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2eee8);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(44, 68, 61, .16);
  font-size: .76rem;
}
.pe-img-tools[hidden] { display: none; }
.pe-it-row { display: flex; align-items: center; gap: 4px; }
.pe-it-label { color: var(--text-2, #7b918a); font-weight: 600; margin-right: 2px; }
.pe-img-tools button {
  border: 1px solid var(--border, #e2eee8);
  background: transparent;
  color: var(--text, #2c443d);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: .74rem;
  cursor: pointer;
  transition: all .14s ease;
}
.pe-img-tools button:hover {
  border-color: var(--primary, #3f9d8b);
  color: var(--primary, #3f9d8b);
  background: var(--fx-mint-50, #f1faf6);
}
.pe-img-tools .pe-it-del {
  margin-left: auto;
  color: var(--danger, #dc7f77);
  border-color: rgba(220, 127, 119, .4);
}
.pe-img-tools .pe-it-del:hover {
  background: rgba(220, 127, 119, .1);
  color: var(--danger, #dc7f77);
  border-color: var(--danger, #dc7f77);
}
.pe-it-tip { font-size: .68rem; color: var(--text-2, #7b918a); }

/* ---------- 题目背景块（详情页 / 编辑页共用，v31 重整） ---------- */
.problem-bg {
  border: 1px dashed var(--border, #e2eee8);
  background: var(--fx-mint-50, #f1faf6);
  border-radius: 12px;
  padding: 16px 18px 18px;
  margin-bottom: 26px;
}
html.dark .problem-bg { background: rgba(255, 255, 255, .03); }
/* 背景块标题与「题目描述 / 输入格式」等小标题保持一致的徽标风格 */
.problem-bg-head {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border, #e2eee8);
  font-size: 1.01rem; font-weight: 700; color: var(--text, #2c443d);
}
.problem-bg-head svg {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border-radius: 8px; padding: 5px; box-sizing: border-box;
  background: var(--fx-mint-100, #e2f4ec); color: var(--primary, #3f9d8b); flex: 0 0 auto;
}
html.dark .problem-bg-head svg { background: rgba(94, 207, 156, .14); color: var(--v15-ok); }
/* 间距由背景块 margin-bottom 提供，避免与首段正文挤在一起 */
.problem-bg + .problem-sec { margin-top: 0; }
.problem-bg .rich-view { color: var(--text, #2c443d); }
/* 背景内的小图表：与正文协调（行内小图垂直居中、不溢出、与文字留白） */
.problem-bg .rich-view img,
.problem-bg .problem-content img {
  vertical-align: middle; max-height: 2em; margin: 0 2px; border-radius: 4px;
}
.problem-bg .rich-view .pe-img-block,
.problem-bg .problem-content .pe-img-block { margin: 10px 0; }
.problem-bg .rich-view .pe-img-block img,
.problem-bg .problem-content .pe-img-block img { max-height: none; width: auto; }

/* 展示端：图片不溢出、按编辑时设定的宽度呈现 */
.problem-content img { max-width: 100%; height: auto; border-radius: 6px; }
.problem-content .pe-img-block { margin: 8px 0; }

@media (max-width: 575.98px) {
  .pe-hint { display: none; }
  .pe-canvas { padding: 10px 12px; min-height: 120px; }
  .pe-img-tools { font-size: .72rem; }
}

/* ---------- v29：编辑页顶部「删除本题」+ 确认弹窗 ---------- */
.pe-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.pe-head .form-page-title { margin-bottom: 0 !important; }
.pe-del-btn {
  border: 1px solid rgba(196, 92, 80, .42);
  background: #fff6f4; color: #a4473d;
  border-radius: 10px; padding: 7px 14px;
  font-weight: 600; white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.pe-del-btn:hover, .pe-del-btn:focus-visible {
  background: #fde9e5; color: #8d352c; border-color: rgba(170, 63, 51, .6);
}
.pe-del-modal .modal-content {
  background: var(--card-bg, #fff); color: var(--text, #2c443d);
  border: 1px solid var(--border, #e2eee8); border-radius: 16px;
}
.pe-del-modal .modal-header { border-bottom: 1px solid var(--border, #e6f0eb); }
.pe-del-modal .modal-footer { border-top: 1px solid var(--border, #e6f0eb); }
.pe-del-modal .modal-title { color: #a4473d; font-weight: 700; }
.pe-del-note {
  border: 1px solid var(--border, #dceae4); border-radius: 10px;
  background: var(--fx-mint-50, #f1faf6);
  color: var(--text-2, #5d7a70);
  font-size: .84rem; line-height: 1.75; padding: 9px 12px;
}
html.dark .pe-del-btn {
  background: #332523; color: #f0aaa2; border-color: #5c3a35;
}
html.dark .pe-del-btn:hover, html.dark .pe-del-btn:focus-visible {
  background: #412b28; color: #ffc2b9; border-color: #85544b;
}
html.dark .pe-del-modal .modal-content {
  background: #1c2b25; color: #dcece5; border-color: #2b4038;
}
html.dark .pe-del-modal .modal-title { color: #f0aaa2; }
html.dark .pe-del-note {
  background: #172821; border-color: #2b4038; color: #b9d4c8;
}
@media (max-width: 575.98px) {
  .pe-head { gap: 8px; }
  .pe-del-btn { width: 100%; }
}

/* ---------- 共享公式编辑器（v31 新增，fx_formula.js） ---------- */
.fxf-mask {
  position: fixed; inset: 0; z-index: 1080;
  background: rgba(0, 0, 0, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
}
.fxf-mask.show { opacity: 1; pointer-events: auto; }
.fxf-box {
  width: 100%; max-width: 720px; max-height: 90vh;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2eee8);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .18);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.fxf-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--border, #e2eee8);
  background: var(--fx-mint-50, #f1faf6);
}
.fxf-palette { display: flex; gap: 4px; flex-wrap: wrap; }
.fxf-pg {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 10px; border-radius: 8px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2eee8);
  font-size: .88rem; cursor: pointer; user-select: none;
  color: var(--text, #2c443d);
  transition: background .12s, border-color .12s;
}
.fxf-pg:hover { background: var(--fx-mint-100, #e2f4ec); border-color: var(--primary, #3f9d8b); }
.fxf-pg.active { background: var(--primary, #3f9d8b); color: #fff; border-color: var(--primary, #3f9d8b); }
.fxf-help {
  font-size: .8rem; color: var(--text-2, #7b918a);
  text-decoration: none; white-space: nowrap;
}
.fxf-help:hover { color: var(--primary, #3f9d8b); }

.fxf-symbols {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #e2eee8);
  min-height: 44px;
}
.fxf-sym {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2eee8);
  font-size: 1rem; cursor: pointer; user-select: none;
  color: var(--text, #2c443d);
  transition: background .12s, border-color .12s, color .12s;
}
.fxf-sym:hover { background: var(--fx-mint-100, #e2f4ec); border-color: var(--primary, #3f9d8b); color: var(--primary, #3f9d8b); }

.fxf-mid {
  display: flex; gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--border, #e2eee8);
}
.fxf-preview {
  flex: 0 0 42%;
  background: var(--fx-mint-50, #f1faf6);
  border: 1px solid var(--border, #e2eee8);
  border-radius: 10px; padding: 12px;
  overflow-y: auto; max-height: 220px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2, #7b918a); font-size: .88rem;
}
.fxf-preview:empty::after { content: '预览'; }
.fxf-input {
  flex: 1 1 auto; min-height: 120px;
  border: 1px solid var(--border, #e2eee8);
  border-radius: 10px; padding: 10px 12px;
  font-family: ui-monospace, 'Fira Code', Consolas, monospace;
  font-size: .95rem; resize: vertical;
  background: var(--card-bg, #fff);
  color: var(--text, #2c443d);
}
.fxf-input:focus { outline: none; border-color: var(--primary, #3f9d8b); box-shadow: 0 0 0 3px rgba(63,157,139,.12); }

.fxf-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 14px;
}
.fxf-left { display: flex; gap: 8px; }
.fxf-right { display: flex; align-items: center; gap: 10px; }
.fxf-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 6px 12px; border-radius: 8px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2eee8);
  color: var(--text, #2c443d);
  font-size: .88rem; cursor: pointer; user-select: none;
  transition: background .12s, border-color .12s;
}
.fxf-btn:hover { background: var(--fx-mint-100, #e2f4ec); border-color: var(--primary, #3f9d8b); }
.fxf-ok {
  padding: 6px 18px; border-radius: 8px;
  background: #c0392b; color: #fff; border: none;
  font-size: .9rem; cursor: pointer;
  transition: filter .12s, transform .06s;
}
.fxf-ok:hover { filter: brightness(1.1); }
.fxf-ok:active { transform: scale(.97); }
.fxf-hint { color: var(--text-2, #7b918a); font-size: .82rem; user-select: none; }
.fxf-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: transparent; color: var(--text-2, #7b918a);
  font-size: 1.2rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.fxf-close:hover { background: rgba(0,0,0,.05); color: var(--text, #2c443d); }

.fxf-box { position: relative; }

/* 手绘遮罩 */
.fxf-draw-mask {
  position: fixed; inset: 0; z-index: 1090;
  background: rgba(0, 0, 0, .6);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
}
.fxf-draw-mask.show { opacity: 1; pointer-events: auto; }
.fxf-draw-box {
  width: 100%; max-width: 720px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2eee8);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .18);
  display: flex; flex-direction: column;
}
.fxf-draw-head {
  padding: 10px 14px; border-bottom: 1px solid var(--border, #e2eee8);
  font-size: .92rem; font-weight: 600; color: var(--text, #2c443d);
  background: var(--fx-mint-50, #f1faf6);
}
.fxf-draw-head span { font-weight: 400; color: var(--text-2, #7b918a); margin-left: 6px; }
.fxf-canvas {
  /* v55：保持与 canvas 固有像素(600×300 = 2:1)一致的显示比例，
     笔迹才不会被拉伸变形；坐标换算由 fx_formula.js 按 rect 缩放处理。 */
  display: block; width: 100%; height: auto; aspect-ratio: 2 / 1;
  background: #fff; cursor: crosshair;
  touch-action: none;
}
.fxf-draw-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--border, #e2eee8);
}
.fxf-draw-btn {
  padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--border, #e2eee8);
  background: var(--card-bg, #fff); color: var(--text, #2c443d);
  cursor: pointer; font-size: .88rem;
}
.fxf-draw-btn.primary { background: #c0392b; color: #fff; border-color: #c0392b; }
.fxf-draw-btn.primary:hover { filter: brightness(1.1); }

/* 题目编辑器右键菜单 */
.pe-ctxmenu {
  position: fixed; z-index: 1070;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2eee8);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.14);
  padding: 4px; min-width: 140px;
  display: flex; flex-direction: column; gap: 2px;
}
.pe-ctx-item {
  display: block; width: 100%; text-align: left;
  padding: 6px 10px; border: none; border-radius: 6px;
  background: transparent; color: var(--text, #2c443d);
  font-size: .85rem; cursor: pointer; white-space: nowrap;
}
.pe-ctx-item:hover { background: var(--fx-mint-100, #e2f4ec); color: var(--primary, #3f9d8b); }

