/* ================================================================
   富文本编辑器 + 会员等级徽章
   ================================================================ */
.editor { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); position: relative; }
.editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.editor-drag { border-color: var(--primary); background: var(--primary-soft); }

.editor-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  padding: 6px 8px; border-bottom: 1px solid var(--border);
  background: var(--panel); border-radius: var(--radius) var(--radius) 0 0;
  position: sticky; top: 0; z-index: 5;
}
.editor-group { display: flex; gap: 1px; padding: 0 4px; border-right: 1px solid var(--border); }
.editor-group:last-child { border-right: none; }
.editor-btn {
  min-width: 30px; height: 30px; padding: 0 6px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-sub); cursor: pointer;
  font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s var(--ease-ios);
}
.editor-btn:hover { background: var(--hover-row); color: var(--text); }
.editor-btn:active { transform: scale(.92); }
.ed-bold { font-weight: 800; }
.ed-italic { font-style: italic; }
.ed-underline { text-decoration: underline; }
.ed-strike { text-decoration: line-through; }
.ed-h { font-size: 12.5px; }

.editor-area {
  min-height: 180px; max-height: 460px; overflow-y: auto;
  padding: 14px 16px; outline: none; background: var(--panel-2);
  font-size: 14.5px; line-height: 1.75; color: var(--text);
}
.editor-empty::before {
  content: attr(data-placeholder); color: var(--text-muted); pointer-events: none;
}

.editor-area h2, .editor-area h3 { margin: 14px 0 8px; font-weight: 700; line-height: 1.35; }
.editor-area h2 { font-size: 19px; }
.editor-area h3 { font-size: 16px; }
.editor-area p { margin: 0 0 10px; }
.editor-area blockquote {
  margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--primary);
  background: var(--primary-soft); border-radius: 0 8px 8px 0; color: var(--text-sub);
}
.editor-area pre {
  margin: 10px 0; padding: 12px 14px; background: var(--code-bg); border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
.editor-area ul, .editor-area ol { margin: 8px 0; padding-left: 24px; }
.editor-area li { margin: 3px 0; }
.editor-area a { color: var(--primary); text-decoration: underline; }
.editor-area img {
  max-width: 100%; height: auto; border-radius: 10px; margin: 8px 0;
  border: 1px solid var(--border); display: block;
}
.editor-area hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.editor-uploading { color: var(--text-muted); font-style: italic; }

.editor-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; border-top: 1px solid var(--border); background: var(--panel);
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 12px; color: var(--text-muted);
}

.editor-emoji {
  position: absolute; z-index: 20; top: 42px; left: 8px;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  padding: 8px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
}
.editor-emoji[hidden] { display: none; }
.emoji-item {
  width: 30px; height: 30px; border: none; background: transparent; border-radius: 7px;
  font-size: 18px; cursor: pointer; line-height: 1;
}
.emoji-item:hover { background: var(--hover-row); transform: scale(1.15); }

.modal-body-editor .field:last-child { margin-bottom: 0; }

/* ---------- 会员等级徽章 ---------- */
.lv-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 600;
  line-height: 1.6; white-space: nowrap;
  color: var(--lv-color, var(--text-muted));
  background: color-mix(in srgb, var(--lv-color, #8b95a1) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--lv-color, #8b95a1) 30%, transparent);
}
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .lv-badge { background: var(--code-bg); border-color: var(--border); }
}

/* ---------- 回复可见块 ---------- */
.editor-area .hide-block,
.editor-area .hide-open {
  margin: 10px 0; padding: 10px 14px; border-radius: 10px;
  border: 1px dashed var(--primary); background: var(--primary-soft);
  position: relative;
}
.editor-area .hide-block::before {
  content: '🔒 回复可见'; display: block; margin-bottom: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--primary);
}
