/* ===== UBB Editor — 统一模板样式 ===== */

/* --- Modal overlay --- */
#ubbEditorModal.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
#ubbEditorModal.modal-overlay.show { display: flex; }

#ubbEditorModal .modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

#ubbEditorModal .modal-content h3 {
  margin: 0 0 12px;
  color: var(--nankai-blue, #1a5276);
  font-size: 16px;
}

/* --- 引用/编辑提示信息 --- */
#ubbEditorModal .ubb-ref-info {
  font-size: 12px;
  color: #c0392b;
  background: #fdf2f2;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 10px;
  display: none;
}

/* --- 标题输入 --- */
#ubbEditorModal #ubbTitleRow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
#ubbEditorModal #ubbTitleRow.hidden { display: none; }
#ubbEditorModal #ubbTitleRow label {
  font-size: 13px;
  color: #555;
  white-space: nowrap;
  flex-shrink: 0;
}
#ubbEditorModal #ubbTitleRow input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
}
#ubbEditorModal #ubbTitleRow input:focus {
  outline: none;
  border-color: var(--soft-blue, #8bb7d6);
}

/* --- UBB toolbar --- */
#ubbEditorModal .ubb-toolbar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}
#ubbEditorModal .ubb-toolbar button {
  padding: 4px 10px;
  border: 1px solid #ddd;
  background: #f8f8f8;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}
#ubbEditorModal .ubb-toolbar button:hover {
  background: #e8f0fe;
  border-color: #8bb7d6;
}

/* --- Contenteditable div --- */
#ubbEditorModal div#ubbContent {
  width: 100%;
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  font-family: "Microsoft YaHei","PingFang SC",sans-serif;
  box-sizing: border-box;
  line-height: 1.6;
  cursor: text;
  word-break: break-word;
}
#ubbEditorModal div#ubbContent:focus {
  outline: none;
  border-color: #8bb7d6;
}
/* Placeholder effect for contenteditable */
#ubbEditorModal div#ubbContent:empty::before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}

/* --- 表情选择器 --- */
#ubbEditorModal .ubb-express {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 0;
  border-top: 1px solid #eee;
  margin-top: 6px;
  min-height: 32px;
}
#ubbEditorModal .ubb-express img {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 2px;
  width: 22px;
  height: 22px;
}
#ubbEditorModal .ubb-express img:hover {
  border-color: #8bb7d6;
  background: #e8f0fe;
}

/* --- 操作按钮 --- */
#ubbEditorModal .modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
#ubbEditorModal .modal-actions .btn-primary {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  background: var(--nankai-blue, #1a5276);
  color: #fff;
  border: none;
}
#ubbEditorModal .modal-actions .btn-primary:hover {
  background: #154360;
}
#ubbEditorModal .modal-actions .btn-cancel {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  background: #eee;
  color: #333;
  border: 1px solid #ddd;
}
#ubbEditorModal .modal-actions .btn-cancel:hover {
  background: #ddd;
}
